diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-05-11 22:23:56 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-13 12:55:20 +0000 |
commit | 3d5ba9f86e32950204bfcdf6591c4740a8ef7507 (patch) | |
tree | 9c599ad6b7fd2bd06d0880dde70ff21d6f522bef /src/qml/compiler/qv4instr_moth_p.h | |
parent | 2d6b08bd17377aa6bcb663029a196a8d19cac6ac (diff) |
Add instructions to simplify for-of loops
Added an IteratorNext instruction to fetch the next
iteration value (empty if the iterator is done).
This will also help to implement array destructuring without
requiring huge amounts of byte code.
Change-Id: If96c1e81471e5e2b0b7b2af122238d87741aa371
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 | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h index 96ab593609..301a43a519 100644 --- a/src/qml/compiler/qv4instr_moth_p.h +++ b/src/qml/compiler/qv4instr_moth_p.h @@ -122,6 +122,7 @@ QT_BEGIN_NAMESPACE #define INSTR_PopScriptContext(op) INSTRUCTION(op, PopScriptContext, 0) #define INSTR_PopContext(op) INSTRUCTION(op, PopContext, 1, reg) #define INSTR_GetIterator(op) INSTRUCTION(op, GetIterator, 1, iterator) +#define INSTR_IteratorNext(op) INSTRUCTION(op, IteratorNext, 0) #define INSTR_DeleteMember(op) INSTRUCTION(op, DeleteMember, 2, member, base) #define INSTR_DeleteSubscript(op) INSTRUCTION(op, DeleteSubscript, 2, base, index) #define INSTR_DeleteName(op) INSTRUCTION(op, DeleteName, 1, name) @@ -141,6 +142,7 @@ QT_BEGIN_NAMESPACE #define INSTR_JumpTrue(op) INSTRUCTION(op, JumpTrue, 1, offset) #define INSTR_JumpFalse(op) INSTRUCTION(op, JumpFalse, 1, offset) #define INSTR_JumpNotUndefined(op) INSTRUCTION(op, JumpNotUndefined, 1, offset) +#define INSTR_JumpEmpty(op) INSTRUCTION(op, JumpEmpty, 1, offset) #define INSTR_CmpEqNull(op) INSTRUCTION(op, CmpEqNull, 0) #define INSTR_CmpNeNull(op) INSTRUCTION(op, CmpNeNull, 0) #define INSTR_CmpEqInt(op) INSTRUCTION(op, CmpEqInt, 1, lhs) @@ -248,6 +250,7 @@ QT_BEGIN_NAMESPACE F(PopScriptContext) \ F(PopContext) \ F(GetIterator) \ + F(IteratorNext) \ F(DeleteMember) \ F(DeleteSubscript) \ F(DeleteName) \ @@ -266,6 +269,7 @@ QT_BEGIN_NAMESPACE F(JumpTrue) \ F(JumpFalse) \ F(JumpNotUndefined) \ + F(JumpEmpty) \ F(CmpEqNull) \ F(CmpNeNull) \ F(CmpEqInt) \ |