diff options
Diffstat (limited to 'src/qml/jsruntime/qv4context.cpp')
-rw-r--r-- | src/qml/jsruntime/qv4context.cpp | 33 |
1 files changed, 13 insertions, 20 deletions
diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp index 97b3e26a26..390a5e7d7a 100644 --- a/src/qml/jsruntime/qv4context.cpp +++ b/src/qml/jsruntime/qv4context.cpp @@ -61,8 +61,9 @@ Heap::CallContext *ExecutionContext::newCallContext(const FunctionObject *functi { Q_ASSERT(function->function()); - Heap::CallContext *c = d()->engine->memoryManager->allocManaged<CallContext>(requiredMemoryForExecutionContect(function, callData->argc)); - new (c) Heap::CallContext(d()->engine, Heap::ExecutionContext::Type_CallContext); + Heap::CallContext *c = d()->engine->memoryManager->allocManaged<CallContext>( + requiredMemoryForExecutionContect(function, callData->argc)); + c->init(d()->engine, Heap::ExecutionContext::Type_CallContext); c->function = function->d(); @@ -73,6 +74,7 @@ Heap::CallContext *ExecutionContext::newCallContext(const FunctionObject *functi c->compilationUnit = function->function()->compilationUnit; c->lookups = c->compilationUnit->runtimeLookups; + c->constantTable = c->compilationUnit->constants; c->locals = (Value *)((quintptr(c + 1) + 7) & ~7); const CompiledData::Function *compiledFunction = function->function()->compiledFunction; @@ -159,44 +161,35 @@ void ExecutionContext::createMutableBinding(String *name, bool deletable) activation->__defineOwnProperty__(scope.engine, name, desc, attrs); } - -Heap::GlobalContext::GlobalContext(ExecutionEngine *eng) - : Heap::ExecutionContext(eng, Heap::ExecutionContext::Type_GlobalContext) +void Heap::GlobalContext::init(ExecutionEngine *eng) { + Heap::ExecutionContext::init(eng, Heap::ExecutionContext::Type_GlobalContext); global = eng->globalObject->d(); } -Heap::WithContext::WithContext(ExecutionContext *outerContext, Object *with) - : Heap::ExecutionContext(outerContext->engine, Heap::ExecutionContext::Type_WithContext) -{ - outer = outerContext; - callData = outer->callData; - lookups = outer->lookups; - compilationUnit = outer->compilationUnit; - - withObject = with; -} - -Heap::CatchContext::CatchContext(ExecutionContext *outerContext, String *exceptionVarName, const Value &exceptionValue) - : Heap::ExecutionContext(outerContext->engine, Heap::ExecutionContext::Type_CatchContext) +void Heap::CatchContext::init(ExecutionContext *outerContext, String *exceptionVarName, + const Value &exceptionValue) { + Heap::ExecutionContext::init(outerContext->engine, Heap::ExecutionContext::Type_CatchContext); outer = outerContext; strictMode = outer->strictMode; callData = outer->callData; lookups = outer->lookups; + constantTable = outer->constantTable; compilationUnit = outer->compilationUnit; this->exceptionVarName = exceptionVarName; this->exceptionValue = exceptionValue; } -Heap::QmlContext::QmlContext(QV4::ExecutionContext *outerContext, QV4::QmlContextWrapper *qml) - : Heap::ExecutionContext(outerContext->engine(), Heap::ExecutionContext::Type_QmlContext) +void Heap::QmlContext::init(QV4::ExecutionContext *outerContext, QV4::QmlContextWrapper *qml) { + Heap::ExecutionContext::init(outerContext->engine(), Heap::ExecutionContext::Type_QmlContext); outer = outerContext->d(); strictMode = false; callData = outer->callData; lookups = outer->lookups; + constantTable = outer->constantTable; compilationUnit = outer->compilationUnit; this->qml = qml->d(); |