aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4functionobject.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@digia.com>2014-11-27 15:18:41 +0100
committerSimon Hausmann <simon.hausmann@digia.com>2014-12-19 16:30:05 +0100
commit0eac5a4938affdb930201df8be91cb9b6e1c93ac (patch)
treee8045867a15d87a61d9ed4e2ae2e697fab0e5a37 /src/qml/jsruntime/qv4functionobject.cpp
parenta0c81e29713f991afa0a2442a7ca3b095ad97c2a (diff)
Make ExecutionContextSaver GC safe
Change-Id: I29f00366d24c770afe4ba4579106d81a8c9043df Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject.cpp')
-rw-r--r--src/qml/jsruntime/qv4functionobject.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp
index db2f236f3b..6a0496d1c5 100644
--- a/src/qml/jsruntime/qv4functionobject.cpp
+++ b/src/qml/jsruntime/qv4functionobject.cpp
@@ -401,7 +401,7 @@ ReturnedValue ScriptFunction::construct(Managed *that, CallData *callData)
callData->thisObject = obj.asReturnedValue();
Scoped<CallContext> ctx(scope, context->newCallContext(f.getPointer(), callData));
- ExecutionContextSaver ctxSaver(context);
+ ExecutionContextSaver ctxSaver(scope, context);
ScopedValue result(scope, Q_V4_PROFILE(v4, f->function()));
if (f->function()->compiledFunction->hasQmlDependencies())
@@ -428,7 +428,7 @@ ReturnedValue ScriptFunction::call(Managed *that, CallData *callData)
Scoped<CallContext> ctx(scope, context->newCallContext(f, callData));
- ExecutionContextSaver ctxSaver(context);
+ ExecutionContextSaver ctxSaver(scope, context);
ScopedValue result(scope, Q_V4_PROFILE(v4, f->function()));
if (f->function()->compiledFunction->hasQmlDependencies())
@@ -483,7 +483,7 @@ ReturnedValue SimpleScriptFunction::construct(Managed *that, CallData *callData)
callData->thisObject = v4->newObject(ic, proto);
ExecutionContext *context = v4->currentContext();
- ExecutionContextSaver ctxSaver(context);
+ ExecutionContextSaver ctxSaver(scope, context);
CallContext::Data ctx(v4);
ctx.strictMode = f->strictMode();
@@ -520,7 +520,7 @@ ReturnedValue SimpleScriptFunction::call(Managed *that, CallData *callData)
Scope scope(v4);
ExecutionContext *context = v4->currentContext();
- ExecutionContextSaver ctxSaver(context);
+ ExecutionContextSaver ctxSaver(scope, context);
CallContext::Data ctx(v4);
ctx.strictMode = f->strictMode();
@@ -577,8 +577,9 @@ ReturnedValue BuiltinFunction::call(Managed *that, CallData *callData)
return Encode::undefined();
CHECK_STACK_LIMITS(v4);
+ Scope scope(v4);
ExecutionContext *context = v4->currentContext();
- ExecutionContextSaver ctxSaver(context);
+ ExecutionContextSaver ctxSaver(scope, context);
CallContext::Data ctx(v4);
ctx.strictMode = f->scope()->strictMode; // ### needed? scope or parent context?
@@ -596,8 +597,9 @@ ReturnedValue IndexedBuiltinFunction::call(Managed *that, CallData *callData)
return Encode::undefined();
CHECK_STACK_LIMITS(v4);
+ Scope scope(v4);
ExecutionContext *context = v4->currentContext();
- ExecutionContextSaver ctxSaver(context);
+ ExecutionContextSaver ctxSaver(scope, context);
CallContext::Data ctx(v4);
ctx.strictMode = f->scope()->strictMode; // ### needed? scope or parent context?