diff options
author | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-08-14 02:57:45 +0200 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@theqtcompany.com> | 2015-08-16 20:14:58 +0000 |
commit | 94e337fa95425d259e81b4d21f4d0853108553bd (patch) | |
tree | 37c0d9941c71d83cfdd5269b93535f2f69bb9e4d /src/quick/items/qquickloader.cpp | |
parent | 26a230ee0ed68d39d4d13bfeaafd9839ee2a2a00 (diff) |
Avoid firing up the JS parser/JIT/interpreter when instantiating objects
For setting the initial properties there's no need to run a JavaScript
function.
Change-Id: I129fa8e7128cd7aa784e34912ce636cd33b1dd66
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Diffstat (limited to 'src/quick/items/qquickloader.cpp')
-rw-r--r-- | src/quick/items/qquickloader.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/quick/items/qquickloader.cpp b/src/quick/items/qquickloader.cpp index df09780895..d46e25d255 100644 --- a/src/quick/items/qquickloader.cpp +++ b/src/quick/items/qquickloader.cpp @@ -576,7 +576,6 @@ void QQuickLoader::setSource(QQmlV4Function *args) if (!ipv->isUndefined()) { d->disposeInitialPropertyValues(); d->initialPropertyValues.set(args->v4engine(), ipv); - d->qmlGlobalForIpv.set(args->v4engine(), args->qmlGlobal()); } setSource(sourceUrl, false); // already cleared and set ipv above. @@ -642,11 +641,11 @@ void QQuickLoaderPrivate::setInitialState(QObject *obj) QQmlComponentPrivate *d = QQmlComponentPrivate::get(component); Q_ASSERT(d && d->engine); - QV4::ExecutionEngine *v4 = qmlGlobalForIpv.engine(); + QV4::ExecutionEngine *v4 = QV8Engine::getV4(d->engine); Q_ASSERT(v4); QV4::Scope scope(v4); QV4::ScopedValue ipv(scope, initialPropertyValues.value()); - d->initializeObjectWithInitialProperties(*qmlGlobalForIpv.valueRef(), ipv, obj); + d->initializeObjectWithInitialProperties(ipv, obj); } void QQuickLoaderIncubator::statusChanged(Status status) |