diff options
author | Lars Knoll <lars.knoll@digia.com> | 2014-02-06 15:05:35 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-02-07 10:44:30 +0100 |
commit | aaa8257d988f10f8a6f92d6e687d9aaf678aa05c (patch) | |
tree | 73fee6efd269ef1cc8ccabd44ccce893b21331e0 /src/qml/compiler | |
parent | cd3736db10a8105d8dca09327b6efb139ce2ed1b (diff) |
Specialize CJump into JumpEq and JumpNe
This avoids the bool invert in the instruction
stream, and some additional code in the VME.
Change-Id: I0ea675a2e3d07c1b8c5234b888d8d9683bcee330
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/compiler')
-rw-r--r-- | src/qml/compiler/qv4instr_moth_p.h | 14 | ||||
-rw-r--r-- | src/qml/compiler/qv4isel_moth.cpp | 12 |
2 files changed, 16 insertions, 10 deletions
diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h index c49b0798ad..7d15b4b010 100644 --- a/src/qml/compiler/qv4instr_moth_p.h +++ b/src/qml/compiler/qv4instr_moth_p.h @@ -107,7 +107,8 @@ QT_BEGIN_NAMESPACE F(CreateActivationProperty, createActivationProperty) \ F(ConstructGlobalLookup, constructGlobalLookup) \ F(Jump, jump) \ - F(CJump, cjump) \ + F(JumpEq, jumpEq) \ + F(JumpNe, jumpNe) \ F(UNot, unot) \ F(UNotBool, unotBool) \ F(UPlus, uplus) \ @@ -556,11 +557,15 @@ union Instr MOTH_INSTR_HEADER ptrdiff_t offset; }; - struct instr_cjump { + struct instr_jumpEq { + MOTH_INSTR_HEADER + ptrdiff_t offset; + Param condition; + }; + struct instr_jumpNe { MOTH_INSTR_HEADER ptrdiff_t offset; Param condition; - bool invert; }; struct instr_unot { MOTH_INSTR_HEADER @@ -796,7 +801,8 @@ union Instr instr_createActivationProperty createActivationProperty; instr_constructGlobalLookup constructGlobalLookup; instr_jump jump; - instr_cjump cjump; + instr_jumpEq jumpEq; + instr_jumpNe jumpNe; instr_unot unot; instr_unotBool unotBool; instr_uplus uplus; diff --git a/src/qml/compiler/qv4isel_moth.cpp b/src/qml/compiler/qv4isel_moth.cpp index 79077b6797..df102af73b 100644 --- a/src/qml/compiler/qv4isel_moth.cpp +++ b/src/qml/compiler/qv4isel_moth.cpp @@ -918,16 +918,16 @@ void InstructionSelection::visitCJump(V4IR::CJump *s) Q_UNIMPLEMENTED(); } - Instruction::CJump jump; - jump.offset = 0; - jump.condition = condition; - if (s->iftrue == _nextBlock) { - jump.invert = true; + Instruction::JumpNe jump; + jump.offset = 0; + jump.condition = condition; ptrdiff_t falseLoc = addInstruction(jump) + (((const char *)&jump.offset) - ((const char *)&jump)); _patches[s->iffalse].append(falseLoc); } else { - jump.invert = false; + Instruction::JumpEq jump; + jump.offset = 0; + jump.condition = condition; ptrdiff_t trueLoc = addInstruction(jump) + (((const char *)&jump.offset) - ((const char *)&jump)); _patches[s->iftrue].append(trueLoc); |