aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4instr_moth_p.h
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2017-08-04 13:38:33 +0200
committerErik Verbruggen <erik.verbruggen@qt.io>2017-08-18 09:56:28 +0000
commit4f9875a10ff67aafebe227e9f5ea1b7b97abb52e (patch)
tree75504c1c17304c5118ac8ffc84bb626dbdd6d1c2 /src/qml/compiler/qv4instr_moth_p.h
parentebc6979801d86ae79dbbbb64c8793d90e0508d18 (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_p.h')
-rw-r--r--src/qml/compiler/qv4instr_moth_p.h17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/qml/compiler/qv4instr_moth_p.h b/src/qml/compiler/qv4instr_moth_p.h
index 63b117dc0e..d07e44c41b 100644
--- a/src/qml/compiler/qv4instr_moth_p.h
+++ b/src/qml/compiler/qv4instr_moth_p.h
@@ -144,6 +144,8 @@ QT_BEGIN_NAMESPACE
F(CmpJmpLe, cmpJmpLe) \
F(JumpStrictEqual, jumpStrictEqual) \
F(JumpStrictNotEqual, jumpStrictNotEqual) \
+ F(JumpStrictEqualStackSlotInt, jumpStrictEqualStackSlotInt) \
+ F(JumpStrictNotEqualStackSlotInt, jumpStrictNotEqualStackSlotInt) \
F(UNot, unot) \
F(UPlus, uplus) \
F(UMinus, uminus) \
@@ -247,7 +249,6 @@ union Instr
};
struct instr_ret {
MOTH_INSTR_HEADER
- StackSlot result;
};
#ifndef QT_NO_QML_DEBUGGING
@@ -597,6 +598,18 @@ union Instr
ptrdiff_t offset;
StackSlot lhs;
};
+ struct instr_jumpStrictEqualStackSlotInt {
+ MOTH_INSTR_HEADER
+ ptrdiff_t offset;
+ StackSlot lhs;
+ int rhs;
+ };
+ struct instr_jumpStrictNotEqualStackSlotInt {
+ MOTH_INSTR_HEADER
+ ptrdiff_t offset;
+ StackSlot lhs;
+ int rhs;
+ };
struct instr_unot {
MOTH_INSTR_HEADER
};
@@ -770,6 +783,8 @@ union Instr
instr_cmpJmpLe cmpJmpLe;
instr_jumpStrictEqual jumpStrictEqual;
instr_jumpStrictNotEqual jumpStrictNotEqual;
+ instr_jumpStrictEqualStackSlotInt jumpStrictEqualStackSlotInt;
+ instr_jumpStrictNotEqualStackSlotInt jumpStrictNotEqualStackSlotInt;
instr_unot unot;
instr_uplus uplus;
instr_uminus uminus;