aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4value_def_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2013-09-11 11:28:27 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2013-09-12 21:52:39 +0200
commita30799396472f2db5978036a64dcb4a4a74cd0b3 (patch)
tree667ac55038feaef3da0aeb18dba024221db2b1d1 /src/qml/jsruntime/qv4value_def_p.h
parentc4b984d099b9653bfa0e282daed0bf466123c341 (diff)
Convert ReturnedValue into a primitive (typedef to quint64)
ReturnedValue is used to return values from runtime methods The type has to be a primitive type (no struct or union), so that the compiler will return it in a register on all platforms. They will be returned in rax on x64, [eax,edx] on x86 and [r0,r1] on arm. Change-Id: I38433e6fad252370dda5dc335d9c5be8f22e8c76 Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4value_def_p.h')
-rw-r--r--src/qml/jsruntime/qv4value_def_p.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4value_def_p.h b/src/qml/jsruntime/qv4value_def_p.h
index 7ca7a8c756..c55ad0c6f7 100644
--- a/src/qml/jsruntime/qv4value_def_p.h
+++ b/src/qml/jsruntime/qv4value_def_p.h
@@ -272,6 +272,9 @@ struct Q_QML_EXPORT Value
inline ExecutionEngine *engine() const;
+ ReturnedValue asReturnedValue() const { return val; }
+ static Value fromReturnedValue(ReturnedValue val) { Value v; v.val = val; return v; }
+
// Section 9.12
bool sameValue(Value other) const;