aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4bytecodegenerator_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-08-25 10:53:51 +0200
committerLars Knoll <lars.knoll@qt.io>2017-08-28 13:19:14 +0000
commit2daf6cb390d3c84dd456d9597e5728a3277eb0d4 (patch)
tree35c1ab80376ca6177af2565e08a47c08349069ad /src/qml/compiler/qv4bytecodegenerator_p.h
parent41a4e387222a117e1cb47c119858c69e0d193e4f (diff)
Compress jump instructions as well
Change-Id: If95a5733594a1beaa41063249a364988190844c5 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4bytecodegenerator_p.h')
-rw-r--r--src/qml/compiler/qv4bytecodegenerator_p.h14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/qml/compiler/qv4bytecodegenerator_p.h b/src/qml/compiler/qv4bytecodegenerator_p.h
index d6b4d1b06e..d28d16ff5f 100644
--- a/src/qml/compiler/qv4bytecodegenerator_p.h
+++ b/src/qml/compiler/qv4bytecodegenerator_p.h
@@ -236,27 +236,21 @@ private:
friend struct Label;
friend struct ExceptionHandler;
- int addInstructionHelper(Moth::Instr::Type type, const Instr &i, int offsetOfOffset = -1) {
- int pos = instructions.size();
- instructions.append({type, 0, 0, currentLine, offsetOfOffset, -1, { i } });
- return pos;
- }
+ int addInstructionHelper(Moth::Instr::Type type, const Instr &i, int offsetOfOffset = -1);
struct I {
Moth::Instr::Type type;
- uint size;
+ short size;
uint position;
int line;
int offsetForJump;
int linkedLabel;
- union {
- Instr instr;
- char packed[sizeof(Instr) + 2]; // 2 for instruction and prefix
- };
+ char packed[sizeof(Instr) + 2]; // 2 for instruction and prefix
};
void compressInstructions();
void packInstruction(I &i);
+ void adjustJumpOffsets();
QVector<I> instructions;
QVector<int> labels;