aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4bytecodegenerator.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-08-24 16:04:19 +0200
committerLars Knoll <lars.knoll@qt.io>2017-08-28 13:19:04 +0000
commit2951f6105ad3851b38fa66348a4edd3fe7cfa47e (patch)
tree5c42f21917bb90cea98eaa2ee7f47e3cf944558a /src/qml/compiler/qv4bytecodegenerator.cpp
parentcd67176bb24c82b239414c162644ebf9e0d3327e (diff)
Introduce the wide/xwide instruction prefixes
And add proper decoding for the prefixed instructions to the VME and bytecode dumper. We still only generate XWide instructions, that will get fixed in the next change. Change-Id: I6d2dc6a0a4f706044038274ca79e019a6c9bb7d9 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4bytecodegenerator.cpp')
-rw-r--r--src/qml/compiler/qv4bytecodegenerator.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/qml/compiler/qv4bytecodegenerator.cpp b/src/qml/compiler/qv4bytecodegenerator.cpp
index 72c3d4e96f..3ce3acdb86 100644
--- a/src/qml/compiler/qv4bytecodegenerator.cpp
+++ b/src/qml/compiler/qv4bytecodegenerator.cpp
@@ -71,11 +71,12 @@ void BytecodeGenerator::compressInstructions()
{
for (auto &i : instructions) {
Instr instr = i.instr;
- i.packed[0] = static_cast<char>(i.type);
- memcpy(i.packed + 1, reinterpret_cast<char *>(&instr), i.size);
- ++i.size;
+ i.packed[0] = static_cast<char>(Instr::Type::XWide);
+ i.packed[1] = static_cast<char>(i.type);
+ memcpy(i.packed + 2, reinterpret_cast<char *>(&instr), i.size);
+ i.size += 2;
if (i.offsetForJump != -1)
- ++i.offsetForJump;
+ i.offsetForJump += 2;
}
}