aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/compiler/qv4codegen_p.h
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2017-08-18 12:28:04 +0200
committerErik Verbruggen <erik.verbruggen@qt.io>2017-08-18 11:49:39 +0000
commit625fb43d68c84e0384b756f6e3d53f2a8a90ff04 (patch)
treed901ebc0042ec9d747b1dd3d5ab501050752265a /src/qml/compiler/qv4codegen_p.h
parent6b7194492624dc1b492593b011b56a165f13dacd (diff)
Split store-on-stack functions for "known destination"
If the destination slot is known, there is no need to return and use it. This also works around certain versions of GCC that won't recognize the cast-to-void pattern to ignore return results. Change-Id: Iabf7ab1141c4f606030f2dda10ef69d1b090fb72 Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/compiler/qv4codegen_p.h')
-rw-r--r--src/qml/compiler/qv4codegen_p.h13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/qml/compiler/qv4codegen_p.h b/src/qml/compiler/qv4codegen_p.h
index 8d0fe7f056..a21b646484 100644
--- a/src/qml/compiler/qv4codegen_p.h
+++ b/src/qml/compiler/qv4codegen_p.h
@@ -281,9 +281,15 @@ public:
RValue asRValue() const;
Reference asLValue() const;
- static Reference storeConstOnStack(Codegen *cg, QV4::ReturnedValue constant, int stackSlot = -1)
- { return Reference::fromConst(cg, constant).storeOnStack(stackSlot); }
- Q_REQUIRED_RESULT Reference storeOnStack(int tempIndex = -1) const;
+
+ Q_REQUIRED_RESULT static Reference storeConstOnStack(Codegen *cg, QV4::ReturnedValue constant)
+ { return Reference::fromConst(cg, constant).storeOnStack(); }
+
+ static void storeConstOnStack(Codegen *cg, QV4::ReturnedValue constant, int stackSlot)
+ { Reference::fromConst(cg, constant).storeOnStack(stackSlot); }
+
+ Q_REQUIRED_RESULT Reference storeOnStack() const;
+ void storeOnStack(int tempIndex) const;
Q_REQUIRED_RESULT Reference storeRetainAccumulator() const;
Reference storeConsumeAccumulator() const;
@@ -328,6 +334,7 @@ public:
private:
void storeAccumulator() const;
+ Reference doStoreOnStack(int tempIndex) const;
};
struct RegisterScope {