aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jsruntime/qv4context.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-08-04 18:53:51 +0200
committerLars Knoll <lars.knoll@qt.io>2017-08-08 18:58:14 +0000
commit50e7badd5f261bd69db9d8f03d5651e346087218 (patch)
tree73c2771fbc98168280182e77337b06efa39f4a7b /src/qml/jsruntime/qv4context.cpp
parent8abb6c41bf055d59c6b57a809e3b027293568848 (diff)
Remove Scope::result and convert calling convention for builtins
Allow for faster calling of builtins, and completely avoid scope creation in many cases. Change-Id: I0f1681e19e9908db10def85a74e134a87fc2e44c Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4context.cpp')
-rw-r--r--src/qml/jsruntime/qv4context.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4context.cpp b/src/qml/jsruntime/qv4context.cpp
index b1fb017f99..db85bc6cef 100644
--- a/src/qml/jsruntime/qv4context.cpp
+++ b/src/qml/jsruntime/qv4context.cpp
@@ -232,7 +232,7 @@ bool ExecutionContext::deleteProperty(String *name)
}
// Do a standard call with this execution context as the outer scope
-void ExecutionContext::call(Scope &scope, CallData *callData, Function *function, const FunctionObject *f)
+ReturnedValue ExecutionContext::call(Scope &scope, CallData *callData, Function *function, const FunctionObject *f)
{
ExecutionContextSaver ctxSaver(scope);
@@ -241,14 +241,16 @@ void ExecutionContext::call(Scope &scope, CallData *callData, Function *function
ctx->d()->function.set(scope.engine, f->d());
scope.engine->pushContext(ctx);
- scope.result = Q_V4_PROFILE(scope.engine, function);
+ ReturnedValue res = Q_V4_PROFILE(scope.engine, function);
if (function->hasQmlDependencies)
QQmlPropertyCapture::registerQmlDependencies(function->compiledFunction, scope);
+
+ return res;
}
// Do a simple, fast call with this execution context as the outer scope
-void QV4::ExecutionContext::simpleCall(Scope &scope, CallData *callData, Function *function)
+ReturnedValue QV4::ExecutionContext::simpleCall(Scope &scope, CallData *callData, Function *function)
{
Q_ASSERT(function->canUseSimpleFunction());
@@ -266,11 +268,13 @@ void QV4::ExecutionContext::simpleCall(Scope &scope, CallData *callData, Functio
scope.engine->pushContext(ctx);
Q_ASSERT(scope.engine->current == ctx);
- scope.result = Q_V4_PROFILE(scope.engine, function);
+ ReturnedValue res = Q_V4_PROFILE(scope.engine, function);
if (function->hasQmlDependencies)
QQmlPropertyCapture::registerQmlDependencies(function->compiledFunction, scope);
scope.engine->memoryManager->freeSimpleCallContext();
+
+ return res;
}
void ExecutionContext::setProperty(String *name, const Value &value)