diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-08-24 14:46:09 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-08-28 13:18:44 +0000 |
commit | 062dd5c38379e660c75092260e94d3c5a103ae17 (patch) | |
tree | c5b78c950ae04e06a0bc0b8ca8e2e99ee8f1f5ef /src/qml/compiler/qv4instr_moth_p.h | |
parent | 7ea183a1125df153082f116eaa5e73fb9a68088e (diff) |
Make the offset the last part of any jump instruction
Change-Id: I9aec7ab939082c902a32d4cfd00b5e00ad3683bc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4instr_moth_p.h')
-rw-r--r-- | src/qml/compiler/qv4instr_moth_p.h | 25 |
1 files changed, 13 insertions, 12 deletions
diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h index 022009eab5..263a469dcc 100644 --- a/src/qml/compiler/qv4instr_moth_p.h +++ b/src/qml/compiler/qv4instr_moth_p.h @@ -70,6 +70,7 @@ QT_BEGIN_NAMESPACE #define INSTRUCTION(op, name, nargs, ...) \ op##_INSTRUCTION(name, nargs, __VA_ARGS__) +/* for all jump instructions, the offset has to come last, to simplify the job of the bytecode generator */ #define INSTR_Nop(op) INSTRUCTION(op, Nop, 0) #define INSTR_Wide(op) INSTRUCTION(op, Wide, 0) #define INSTR_XWide(op) INSTRUCTION(op, XWide, 0) @@ -144,18 +145,18 @@ QT_BEGIN_NAMESPACE #define INSTR_JumpNe(op) INSTRUCTION(op, JumpNe, 1, offset) #define INSTR_CmpJmpEqNull(op) INSTRUCTION(op, CmpJmpEqNull, 1, offset) #define INSTR_CmpJmpNeNull(op) INSTRUCTION(op, CmpJmpNeNull, 1, offset) -#define INSTR_CmpJmpEqInt(op) INSTRUCTION(op, CmpJmpEqInt, 2, offset, lhs) -#define INSTR_CmpJmpNeInt(op) INSTRUCTION(op, CmpJmpNeInt, 2, offset, lhs) -#define INSTR_CmpJmpEq(op) INSTRUCTION(op, CmpJmpEq, 2, offset, lhs) -#define INSTR_CmpJmpNe(op) INSTRUCTION(op, CmpJmpNe, 2, offset, lhs) -#define INSTR_CmpJmpGt(op) INSTRUCTION(op, CmpJmpGt, 2, offset, lhs) -#define INSTR_CmpJmpGe(op) INSTRUCTION(op, CmpJmpGe, 2, offset, lhs) -#define INSTR_CmpJmpLt(op) INSTRUCTION(op, CmpJmpLt, 2, offset, lhs) -#define INSTR_CmpJmpLe(op) INSTRUCTION(op, CmpJmpLe, 2, offset, lhs) -#define INSTR_JumpStrictEqual(op) INSTRUCTION(op, JumpStrictEqual, 2, offset, lhs) -#define INSTR_JumpStrictNotEqual(op) INSTRUCTION(op, JumpStrictNotEqual, 2, offset, lhs) -#define INSTR_JumpStrictEqualStackSlotInt(op) INSTRUCTION(op, JumpStrictEqualStackSlotInt, 3, offset, lhs, rhs) -#define INSTR_JumpStrictNotEqualStackSlotInt(op) INSTRUCTION(op, JumpStrictNotEqualStackSlotInt, 3, offset, lhs, rhs) +#define INSTR_CmpJmpEqInt(op) INSTRUCTION(op, CmpJmpEqInt, 2, lhs, offset) +#define INSTR_CmpJmpNeInt(op) INSTRUCTION(op, CmpJmpNeInt, 2, lhs, offset) +#define INSTR_CmpJmpEq(op) INSTRUCTION(op, CmpJmpEq, 2, lhs, offset) +#define INSTR_CmpJmpNe(op) INSTRUCTION(op, CmpJmpNe, 2, lhs, offset) +#define INSTR_CmpJmpGt(op) INSTRUCTION(op, CmpJmpGt, 2, lhs, offset) +#define INSTR_CmpJmpGe(op) INSTRUCTION(op, CmpJmpGe, 2, lhs, offset) +#define INSTR_CmpJmpLt(op) INSTRUCTION(op, CmpJmpLt, 2, lhs, offset) +#define INSTR_CmpJmpLe(op) INSTRUCTION(op, CmpJmpLe, 2, lhs, offset) +#define INSTR_JumpStrictEqual(op) INSTRUCTION(op, JumpStrictEqual, 2, lhs, offset) +#define INSTR_JumpStrictNotEqual(op) INSTRUCTION(op, JumpStrictNotEqual, 2, lhs, offset) +#define INSTR_JumpStrictEqualStackSlotInt(op) INSTRUCTION(op, JumpStrictEqualStackSlotInt, 3, lhs, rhs, offset) +#define INSTR_JumpStrictNotEqualStackSlotInt(op) INSTRUCTION(op, JumpStrictNotEqualStackSlotInt, 3, lhs, rhs, offset) #define INSTR_UNot(op) INSTRUCTION(op, UNot, 0) #define INSTR_UPlus(op) INSTRUCTION(op, UPlus, 0) #define INSTR_UMinus(op) INSTRUCTION(op, UMinus, 0) |