diff options
| author | Erik Verbruggen <erik.verbruggen@digia.com> | 2016-04-05 13:43:03 +0200 |
|---|---|---|
| committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2016-06-24 07:51:08 +0000 |
| commit | 9ab8b9e4bdf313bb4304be206dd479d4d0848211 (patch) | |
| tree | a8ac32dca10968a0712f5ae53fac1d6de70c39c6 /src/qml/jsruntime/qv4functionobject.cpp | |
| parent | 199ac27505468f222105008fe2729cf559600e2b (diff) | |
QML: Do not register static QML dependencies on every call.
QML objects can be re-parented on the fly, resulting in different
dependencies for expressions like 'parent.width'. So, because of this,
dependencies are cleared and re-calculated after every binding
evaluation.
However, dependencies on properties of the scope and context objects
cannot change, because these objects do not get changed for the
life-time of a binding. So we can permanently register them. This is
only done for bindings, not for functions, because those might be
conditionally executed.
According to valgrind, this is a reduction of ~186 instructions on x86
for every evaluation of:
Item {
height: width
}
Change-Id: Ib095497323d4f08caf712d480007e2627a176369
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4functionobject.cpp')
| -rw-r--r-- | src/qml/jsruntime/qv4functionobject.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/qml/jsruntime/qv4functionobject.cpp b/src/qml/jsruntime/qv4functionobject.cpp index 041044930b..fce80c46eb 100644 --- a/src/qml/jsruntime/qv4functionobject.cpp +++ b/src/qml/jsruntime/qv4functionobject.cpp @@ -435,7 +435,7 @@ void ScriptFunction::construct(const Managed *that, Scope &scope, CallData *call Scoped<ScriptFunction> f(scope, static_cast<const ScriptFunction *>(that)); - InternalClass *ic = scope.engine->emptyClass; + InternalClass *ic = v4->emptyClass; ScopedObject proto(scope, f->protoForConstructor()); ScopedObject obj(scope, v4->newObject(ic, proto)); |
