aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4scopedvalue_p.h
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@theqtcompany.com>2014-11-07 05:46:20 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-11-12 12:13:03 +0100
commit19ae8cdffeaeb3fc6716b6f0a7ee8756ec9700c7 (patch)
tree91083b44b1f3db49c246ce74b20af83310d530f5 /src/qml/jsruntime/qv4scopedvalue_p.h
parent7e61b8c09c647229e78bdedec9421f90063466af (diff)
Convert ExecutionContext::parent/outer to use a heap object
Change-Id: I1b8ee831cfcdd5b1904ce24a341f5a796dce41cf Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4scopedvalue_p.h')
-rw-r--r--src/qml/jsruntime/qv4scopedvalue_p.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h
index 0bb679af78..85ffd81da1 100644
--- a/src/qml/jsruntime/qv4scopedvalue_p.h
+++ b/src/qml/jsruntime/qv4scopedvalue_p.h
@@ -269,6 +269,14 @@ struct Scoped
++scope.size;
#endif
}
+ Scoped(const Scope &scope, typename T::Data *t)
+ {
+ ptr = scope.engine->jsStackTop++;
+ *ptr = Value::fromHeapObject(t);
+#ifndef QT_NO_DEBUG
+ ++scope.size;
+#endif
+ }
template<typename X>
Scoped(const Scope &scope, X *t, _Cast)
{
@@ -325,6 +333,10 @@ struct Scoped
setPointer(value_cast<T>(v));
return *this;
}
+ Scoped<T> &operator=(typename T::Data *t) {
+ *ptr = Value::fromHeapObject(t);
+ return *this;
+ }
Scoped<T> &operator=(const Value &v) {
setPointer(value_cast<T>(v));
return *this;