From 2daf6cb390d3c84dd456d9597e5728a3277eb0d4 Mon Sep 17 00:00:00 2001 From: Lars Knoll Date: Fri, 25 Aug 2017 10:53:51 +0200 Subject: Compress jump instructions as well Change-Id: If95a5733594a1beaa41063249a364988190844c5 Reviewed-by: Simon Hausmann --- src/qml/compiler/qv4bytecodegenerator_p.h | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) (limited to 'src/qml/compiler/qv4bytecodegenerator_p.h') 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 instructions; QVector labels; -- cgit v1.2.3