diff options
| author | Erik Verbruggen <erik.verbruggen@qt.io> | 2017-08-04 13:38:33 +0200 |
|---|---|---|
| committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2017-08-18 09:56:28 +0000 |
| commit | 4f9875a10ff67aafebe227e9f5ea1b7b97abb52e (patch) | |
| tree | 75504c1c17304c5118ac8ffc84bb626dbdd6d1c2 /src/qml/compiler/qv4instr_moth.cpp | |
| parent | ebc6979801d86ae79dbbbb64c8793d90e0508d18 (diff) | |
Don't use a return value register for regular functions
don't use the return value register for normal functions
anymore. It's still needed for eval code and qml bindings
that have an implicit return value, as the accumulator gets
clobbered too easily in those cases.
Also get rid of the exit block we used to generate.
Adjust the control flow handlers to correctly unwind. This
required adding some jump instructions that left the
accumulator untouched (as it now holds the return value)
and using those in handlers.
Change-Id: I2ca1afaf7234cb632e5d26ba5b10ec3f11f50c93
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4instr_moth.cpp')
| -rw-r--r-- | src/qml/compiler/qv4instr_moth.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4instr_moth.cpp b/src/qml/compiler/qv4instr_moth.cpp index b3034e8b81..ed2f556e01 100644 --- a/src/qml/compiler/qv4instr_moth.cpp +++ b/src/qml/compiler/qv4instr_moth.cpp @@ -405,6 +405,14 @@ void dumpBytecode(const char *code, int len, int nFormals) d << instr.lhs.dump(nFormals) << " " << absoluteInstructionOffset(start, instr); MOTH_END_INSTR(JumpStrictNotEqual) + MOTH_BEGIN_INSTR(JumpStrictEqualStackSlotInt) + d << instr.lhs.dump(nFormals) << ", " << instr.rhs << " " << absoluteInstructionOffset(start, instr); + MOTH_END_INSTR(JumpStrictEqualStackSlotInt) + + MOTH_BEGIN_INSTR(JumpStrictNotEqualStackSlotInt) + d << instr.lhs.dump(nFormals) << ", " << instr.rhs << " " << absoluteInstructionOffset(start, instr); + MOTH_END_INSTR(JumpStrictNotEqualStackSlotInt) + MOTH_BEGIN_INSTR(UNot) MOTH_END_INSTR(UNot) @@ -484,7 +492,6 @@ void dumpBytecode(const char *code, int len, int nFormals) MOTH_END_INSTR(BinopContext) MOTH_BEGIN_INSTR(Ret) - d << instr.result.dump(nFormals); MOTH_END_INSTR(Ret) #ifndef QT_NO_QML_DEBUGGER |
