aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/qml/qqmljavascriptexpression.cpp
diff options
context:
space:
mode:
authorLars Knoll <lars.knoll@qt.io>2017-08-07 08:37:45 +0200
committerLars Knoll <lars.knoll@qt.io>2017-08-10 08:18:56 +0000
commit30e3664bf3668bda9a211fe7d1404f8f806dbf7b (patch)
treebd119839af7db0f6f9119401d478b37b44051c8b /src/qml/qml/qqmljavascriptexpression.cpp
parenteb2c08f57493aa12850e6cddff2cc3527e7cbfd7 (diff)
Avoid creating a CallContext for simple functions
This cuts out quite a bit of overhead when entering and leaving functions. Change-Id: I32670c98a4087ea3b2d45853d9cabff9066399e8 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/qml/qqmljavascriptexpression.cpp')
-rw-r--r--src/qml/qml/qqmljavascriptexpression.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp
index e00c8d30be..231708da70 100644
--- a/src/qml/qml/qqmljavascriptexpression.cpp
+++ b/src/qml/qml/qqmljavascriptexpression.cpp
@@ -217,10 +217,11 @@ QV4::ReturnedValue QQmlJavaScriptExpression::evaluate(QV4::CallData *callData, b
QV4::ExecutionEngine *v4 = QV8Engine::getV4(ep->v8engine());
QV4::Scope scope(v4);
+ QV4::ScopedValue value(scope);
QV4::ScopedValue result(scope, QV4::Primitive::undefinedValue());
callData->thisObject = v4->globalObject;
if (scopeObject()) {
- QV4::ScopedValue value(scope, QV4::QObjectWrapper::wrap(v4, scopeObject()));
+ value = QV4::QObjectWrapper::wrap(v4, scopeObject());
if (value->isObject())
callData->thisObject = value;
}