diff options
author | Lars Knoll <lars.knoll@theqtcompany.com> | 2014-12-31 16:03:34 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@digia.com> | 2015-01-08 22:09:23 +0100 |
commit | 776611620ba6e690bd755be9ef9677e796521734 (patch) | |
tree | 07b5b32265e5bf43361f28573deb2b796db0483e /src/qml | |
parent | 7af57a520407086cd29e6fdd45ea69e75d55d13c (diff) |
Remove v8engine from qmlcomponent and canvas2d
Change-Id: I575ba208de24ffe90bd02905aba67b0b08c5115e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Diffstat (limited to 'src/qml')
-rw-r--r-- | src/qml/jsruntime/qv4sequenceobject.cpp | 2 | ||||
-rw-r--r-- | src/qml/qml/qqmlcomponent.cpp | 23 | ||||
-rw-r--r-- | src/qml/qml/qqmltypewrapper.cpp | 5 |
3 files changed, 13 insertions, 17 deletions
diff --git a/src/qml/jsruntime/qv4sequenceobject.cpp b/src/qml/jsruntime/qv4sequenceobject.cpp index fa6af4501e..a60a44642f 100644 --- a/src/qml/jsruntime/qv4sequenceobject.cpp +++ b/src/qml/jsruntime/qv4sequenceobject.cpp @@ -51,7 +51,7 @@ using namespace QV4; // helper function to generate valid warnings if errors occur during sequence operations. static void generateWarning(QV4::ExecutionEngine *v4, const QString& description) { - QQmlEngine *engine = v4->v8Engine->engine(); + QQmlEngine *engine = v4->qmlEngine(); if (!engine) return; QQmlError retn; diff --git a/src/qml/qml/qqmlcomponent.cpp b/src/qml/qml/qqmlcomponent.cpp index 96623f21c3..fd43898770 100644 --- a/src/qml/qml/qqmlcomponent.cpp +++ b/src/qml/qml/qqmlcomponent.cpp @@ -1075,9 +1075,8 @@ namespace QV4 { namespace Heap { struct QmlIncubatorObject : Object { - QmlIncubatorObject(QV8Engine *engine, QQmlIncubator::IncubationMode = QQmlIncubator::Asynchronous); + QmlIncubatorObject(QV4::ExecutionEngine *engine, QQmlIncubator::IncubationMode = QQmlIncubator::Asynchronous); QScopedPointer<QQmlComponentIncubator> incubator; - QV8Engine *v8; QPointer<QObject> parent; QV4::Value valuemap; QV4::Value qmlGlobal; @@ -1363,7 +1362,7 @@ void QQmlComponent::incubateObject(QQmlV4Function *args) QQmlComponentExtension *e = componentExtension(args->v4engine()); - QV4::Scoped<QV4::QmlIncubatorObject> r(scope, v4->memoryManager->alloc<QV4::QmlIncubatorObject>(args->v4engine()->v8Engine, mode)); + QV4::Scoped<QV4::QmlIncubatorObject> r(scope, v4->memoryManager->alloc<QV4::QmlIncubatorObject>(args->v4engine(), mode)); QV4::ScopedObject p(scope, e->incubationProto.value()); r->setPrototype(p); @@ -1387,8 +1386,7 @@ void QQmlComponent::incubateObject(QQmlV4Function *args) void QQmlComponentPrivate::initializeObjectWithInitialProperties(const QV4::ValueRef qmlGlobal, const QV4::ValueRef valuemap, QObject *toCreate) { QQmlEnginePrivate *ep = QQmlEnginePrivate::get(engine); - QV8Engine *v8engine = ep->v8engine(); - QV4::ExecutionEngine *v4engine = QV8Engine::getV4(v8engine); + QV4::ExecutionEngine *v4engine = QV8Engine::getV4(ep->v8engine()); QV4::Scope scope(v4engine); QV4::ScopedValue object(scope, QV4::QObjectWrapper::wrap(v4engine, toCreate)); @@ -1396,8 +1394,8 @@ void QQmlComponentPrivate::initializeObjectWithInitialProperties(const QV4::Valu if (!valuemap->isUndefined()) { QV4::ScopedObject qmlGlobalObj(scope, qmlGlobal); - QV4::ScopedFunctionObject f(scope, QV4::Script::evaluate(QV8Engine::getV4(v8engine), - QString::fromLatin1(INITIALPROPERTIES_SOURCE), qmlGlobalObj)); + QV4::ScopedFunctionObject f(scope, QV4::Script::evaluate(v4engine, + QString::fromLatin1(INITIALPROPERTIES_SOURCE), qmlGlobalObj)); QV4::ScopedCallData callData(scope, 2); callData->thisObject = v4engine->globalObject(); callData->args[0] = object; @@ -1477,9 +1475,8 @@ QQmlComponentExtension::~QQmlComponentExtension() { } -QV4::Heap::QmlIncubatorObject::QmlIncubatorObject(QV8Engine *engine, QQmlIncubator::IncubationMode m) - : QV4::Heap::Object(QV8Engine::getV4(engine)) - , v8(engine) +QV4::Heap::QmlIncubatorObject::QmlIncubatorObject(ExecutionEngine *engine, QQmlIncubator::IncubationMode m) + : QV4::Heap::Object(engine) , valuemap(QV4::Primitive::undefinedValue()) , qmlGlobal(QV4::Primitive::undefinedValue()) , statusChanged(QV4::Primitive::undefinedValue()) @@ -1494,7 +1491,7 @@ void QV4::QmlIncubatorObject::setInitialState(QObject *o) QQmlComponent_setQmlParent(o, d()->parent); if (!d()->valuemap.isUndefined()) { - QV4::ExecutionEngine *v4 = QV8Engine::getV4(d()->v8); + QV4::ExecutionEngine *v4 = engine(); QV4::Scope scope(v4); QV4::ScopedFunctionObject f(scope, QV4::Script::evaluate(v4, QString::fromLatin1(INITIALPROPERTIES_SOURCE), d()->qmlGlobal.asObject())); @@ -1517,7 +1514,7 @@ void QV4::QmlIncubatorObject::markObjects(QV4::Heap::Base *that, QV4::ExecutionE void QV4::QmlIncubatorObject::statusChanged(QQmlIncubator::Status s) { - QV4::Scope scope(QV8Engine::getV4(d()->v8)); + QV4::Scope scope(engine()); // hold the incubated object in a scoped value to prevent it's destruction before this method returns QV4::ScopedObject incubatedObject(scope, QV4::QObjectWrapper::wrap(scope.engine, d()->incubator->object())); @@ -1535,7 +1532,7 @@ void QV4::QmlIncubatorObject::statusChanged(QQmlIncubator::Status s) f->call(callData); if (scope.hasException()) { QQmlError error = scope.engine->catchExceptionAsQmlError(); - QQmlEnginePrivate::warning(QQmlEnginePrivate::get(d()->v8->engine()), error); + QQmlEnginePrivate::warning(QQmlEnginePrivate::get(scope.engine->qmlEngine()), error); } } } diff --git a/src/qml/qml/qqmltypewrapper.cpp b/src/qml/qml/qqmltypewrapper.cpp index 6cdc83a34b..44bb30bd37 100644 --- a/src/qml/qml/qqmltypewrapper.cpp +++ b/src/qml/qml/qqmltypewrapper.cpp @@ -238,8 +238,7 @@ void QmlTypeWrapper::put(Managed *m, String *name, const ValueRef value) return; QV4::Scope scope(v4); - QV8Engine *v8engine = v4->v8Engine; - QQmlContextData *context = v8engine->callingContext(); + QQmlContextData *context = v4->v8Engine->callingContext(); QQmlType *type = w->d()->type; if (type && !type->isSingleton() && w->d()->object) { @@ -248,7 +247,7 @@ void QmlTypeWrapper::put(Managed *m, String *name, const ValueRef value) if (ao) QV4::QObjectWrapper::setQmlProperty(v4, context, ao, name, QV4::QObjectWrapper::IgnoreRevision, value); } else if (type && type->isSingleton()) { - QQmlEngine *e = v8engine->engine(); + QQmlEngine *e = scope.engine->qmlEngine(); QQmlType::SingletonInstanceInfo *siinfo = type->singletonInstanceInfo(); siinfo->init(e); |