diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-09-01 10:09:45 +0200 |
---|---|---|
committer | Lars Knoll <lars.knoll@qt.io> | 2017-09-01 12:31:19 +0000 |
commit | aa8f956e8d742ec25a01dfeb0d7a7ce54b49ed73 (patch) | |
tree | 3f4c8c45ff08d6865fb8fed6bfed3cd6946b038d /src/qml/jsruntime/qv4scopedvalue_p.h | |
parent | 85697da6e1fa5d02afbcef5b3138aef09764443b (diff) |
Move ScopedCallData and ScopedStackFrame into a separate file
Change-Id: I9ae42aa7a811aa93fe0950725e9d253a0c5e8dba
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4scopedvalue_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4scopedvalue_p.h | 41 |
1 files changed, 0 insertions, 41 deletions
diff --git a/src/qml/jsruntime/qv4scopedvalue_p.h b/src/qml/jsruntime/qv4scopedvalue_p.h index 9522e919bd..575f4e6e3f 100644 --- a/src/qml/jsruntime/qv4scopedvalue_p.h +++ b/src/qml/jsruntime/qv4scopedvalue_p.h @@ -52,7 +52,6 @@ #include "qv4engine_p.h" #include "qv4value_p.h" -#include "qv4persistent_p.h" #include "qv4property_p.h" #ifdef V4_USE_VALGRIND @@ -351,46 +350,6 @@ struct Scoped Value *ptr; }; -struct ScopedCallData { - ScopedCallData(const Scope &scope, int argc = 0) - { - int size = int(offsetof(QV4::CallData, args)/sizeof(QV4::Value)) + qMax(argc , int(QV4::Global::ReservedArgumentCount)); - ptr = reinterpret_cast<CallData *>(scope.alloc(size)); - ptr->tag = quint32(QV4::Value::ValueTypeInternal::Integer); - ptr->argc = argc; - } - - CallData *operator->() { - return ptr; - } - - operator CallData *() const { - return ptr; - } - - CallData *ptr; -}; - -struct ScopedStackFrame { - Scope &scope; - CppStackFrame frame; - - ScopedStackFrame(Scope &scope, Heap::ExecutionContext *context) - : scope(scope) - { - frame.parent = scope.engine->currentStackFrame; - if (!context) - return; - frame.jsFrame = reinterpret_cast<CallData *>(scope.alloc(sizeof(CallData)/sizeof(Value))); - frame.jsFrame->context = context; - frame.v4Function = frame.parent ? frame.parent->v4Function : 0; - scope.engine->currentStackFrame = &frame; - } - ~ScopedStackFrame() { - scope.engine->currentStackFrame = frame.parent; - } -}; - inline Value &Value::operator =(const ScopedValue &v) { _val = v.ptr->rawValue(); |