diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2014-11-07 05:46:20 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2014-11-12 12:13:03 +0100 |
commit | 19ae8cdffeaeb3fc6716b6f0a7ee8756ec9700c7 (patch) | |
tree | 91083b44b1f3db49c246ce74b20af83310d530f5 /src/qml/jsruntime/qv4scopedvalue_p.h | |
parent | 7e61b8c09c647229e78bdedec9421f90063466af (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.h | 12 |
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; |