diff options
author | Lars Knoll <lars.knoll@qt.io> | 2018-04-27 11:41:13 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2018-05-03 20:05:14 +0000 |
commit | 5747a7530206ac410b6bd7c1b8490d7d389ad3a5 (patch) | |
tree | afca9153823b1a9efdf878be80922bce693eaefd /src/qml/compiler/qv4instr_moth.cpp | |
parent | 7e6485a046fde121f0e6fdf954162354939ff1d8 (diff) |
Add Generator support
Add support for ES6 generators. Those are currently
always executed in the interpreter (we never JIT them),
to simplify the initial implementation.
Most functionality, except for 'yield *' expressions
are supported. 'yield *' will have to wait until we
support for(... of ...)
Change-Id: I7c059d1e3b301cbcb79e3746b4bec346738fd426
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4instr_moth.cpp')
-rw-r--r-- | src/qml/compiler/qv4instr_moth.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/qml/compiler/qv4instr_moth.cpp b/src/qml/compiler/qv4instr_moth.cpp index bae8d9e64e..49d8455617 100644 --- a/src/qml/compiler/qv4instr_moth.cpp +++ b/src/qml/compiler/qv4instr_moth.cpp @@ -341,6 +341,13 @@ void dumpBytecode(const char *code, int len, int nLocals, int nFormals, int /*st d << dumpRegister(base, nFormals) << "[" << index << "]"; MOTH_END_INSTR(LoadIdObject) + MOTH_BEGIN_INSTR(Yield) + MOTH_END_INSTR(Yield) + + MOTH_BEGIN_INSTR(Resume) + d << ABSOLUTE_OFFSET(); + MOTH_END_INSTR(Resume) + MOTH_BEGIN_INSTR(CallValue) d << dumpRegister(name, nFormals) << dumpArguments(argc, argv, nFormals); MOTH_END_INSTR(CallValue) |