aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorErik Verbruggen <erik.verbruggen@qt.io>2016-12-01 11:15:46 +0100
committerErik Verbruggen <erik.verbruggen@qt.io>2016-12-01 13:57:09 +0000
commitb8e5d7b98eeef61dccf229f6a7ad5c03f4d47e9f (patch)
tree92f8f5bc56d80cc42788bea436bc31c96216b420 /src
parentb19ebe1d23e1f2fd334cef4ec2731ab5cc69dbd7 (diff)
Precalculate and cache hasQmlDependencies
Change-Id: I62b5e167847871f7ead39168ac281ba10e7f7008 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/qml/jsruntime/qv4function.cpp1
-rw-r--r--src/qml/jsruntime/qv4function_p.h1
-rw-r--r--src/qml/jsruntime/qv4functionobject.cpp8
3 files changed, 6 insertions, 4 deletions
diff --git a/src/qml/jsruntime/qv4function.cpp b/src/qml/jsruntime/qv4function.cpp
index caabee322a..e3f839afd2 100644
--- a/src/qml/jsruntime/qv4function.cpp
+++ b/src/qml/jsruntime/qv4function.cpp
@@ -55,6 +55,7 @@ Function::Function(ExecutionEngine *engine, CompiledData::CompilationUnit *unit,
, compilationUnit(unit)
, code(codePtr)
, codeData(0)
+ , hasQmlDependencies(function->hasQmlDependencies())
{
Q_UNUSED(engine);
diff --git a/src/qml/jsruntime/qv4function_p.h b/src/qml/jsruntime/qv4function_p.h
index aeef9ad61b..6e0ba9d764 100644
--- a/src/qml/jsruntime/qv4function_p.h
+++ b/src/qml/jsruntime/qv4function_p.h
@@ -68,6 +68,7 @@ struct Q_QML_EXPORT Function {
InternalClass *internalClass;
uint nFormals;
bool activationRequired;
+ bool hasQmlDependencies;
Function(ExecutionEngine *engine, CompiledData::CompilationUnit *unit, const CompiledData::Function *function,
ReturnedValue (*codePtr)(ExecutionEngine *, const uchar *));
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp
index 2cc58b74a6..6bff0bc5e8 100644
--- a/src/qml/jsruntime/qv4functionobject.cpp
+++ b/src/qml/jsruntime/qv4functionobject.cpp
@@ -454,7 +454,7 @@ void ScriptFunction::construct(const Managed *that, Scope &scope, CallData *call
scope.result = Q_V4_PROFILE(v4, f->function());
- if (f->function()->compiledFunction->hasQmlDependencies())
+ if (f->function()->hasQmlDependencies)
QQmlPropertyCapture::registerQmlDependencies(f->function()->compiledFunction, scope);
if (v4->hasException) {
@@ -481,7 +481,7 @@ void ScriptFunction::call(const Managed *that, Scope &scope, CallData *callData)
scope.result = Q_V4_PROFILE(v4, f->function());
- if (f->function()->compiledFunction->hasQmlDependencies())
+ if (f->function()->hasQmlDependencies)
QQmlPropertyCapture::registerQmlDependencies(f->function()->compiledFunction, scope);
}
@@ -553,7 +553,7 @@ void SimpleScriptFunction::construct(const Managed *that, Scope &scope, CallData
scope.result = Q_V4_PROFILE(v4, f->function());
- if (f->function()->compiledFunction->hasQmlDependencies())
+ if (f->function()->hasQmlDependencies)
QQmlPropertyCapture::registerQmlDependencies(f->function()->compiledFunction, scope);
if (v4->hasException) {
@@ -592,7 +592,7 @@ void SimpleScriptFunction::call(const Managed *that, Scope &scope, CallData *cal
scope.result = Q_V4_PROFILE(v4, f->function());
- if (f->function()->compiledFunction->hasQmlDependencies())
+ if (f->function()->hasQmlDependencies)
QQmlPropertyCapture::registerQmlDependencies(f->function()->compiledFunction, scope);
}