aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/qml/jsruntime/qv4runtime.cpp2
-rw-r--r--src/qml/jsruntime/qv4script.cpp2
-rw-r--r--src/qml/qml/qqmlcontextwrapper.cpp26
-rw-r--r--src/qml/qml/qqmlcontextwrapper_p.h8
-rw-r--r--src/qml/qml/qqmljavascriptexpression.cpp4
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp4
-rw-r--r--src/qml/qml/qqmltypeloader.cpp3
-rw-r--r--src/qml/qml/qqmlxmlhttprequest.cpp2
-rw-r--r--src/qml/types/qquickworkerscript.cpp2
-rw-r--r--tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp2
10 files changed, 26 insertions, 29 deletions
diff --git a/src/qml/jsruntime/qv4runtime.cpp b/src/qml/jsruntime/qv4runtime.cpp
index f6f552119a..7338b8abbe 100644
--- a/src/qml/jsruntime/qv4runtime.cpp
+++ b/src/qml/jsruntime/qv4runtime.cpp
@@ -1417,7 +1417,7 @@ QV4::ReturnedValue Runtime::getQmlSingleton(QV4::NoThrowEngine *engine, int name
Scope scope(engine);
ScopedString name(scope, engine->currentContext()->compilationUnit->runtimeStrings[nameIndex]);
Scoped<QmlContextWrapper> wrapper(scope, engine->qmlContextObject());
- return wrapper->qmlSingletonWrapper(engine->v8Engine, name);
+ return wrapper->qmlSingletonWrapper(engine, name);
}
void Runtime::convertThisToObject(ExecutionEngine *engine)
diff --git a/src/qml/jsruntime/qv4script.cpp b/src/qml/jsruntime/qv4script.cpp
index e696dc838c..9191b53cfc 100644
--- a/src/qml/jsruntime/qv4script.cpp
+++ b/src/qml/jsruntime/qv4script.cpp
@@ -169,7 +169,7 @@ Heap::FunctionObject *QmlBindingWrapper::createQmlCallableForFunction(QQmlContex
{
ExecutionEngine *engine = QQmlEnginePrivate::getV4Engine(qmlContext->engine);
QV4::Scope valueScope(engine);
- QV4::ScopedObject qmlScopeObject(valueScope, QV4::QmlContextWrapper::qmlScope(engine->v8Engine, qmlContext, scopeObject));
+ QV4::ScopedObject qmlScopeObject(valueScope, QV4::QmlContextWrapper::qmlScope(engine, qmlContext, scopeObject));
ScopedContext global(valueScope, valueScope.engine->rootContext());
QV4::Scoped<QV4::QmlBindingWrapper> wrapper(valueScope, engine->memoryManager->alloc<QV4::QmlBindingWrapper>(global, qmlScopeObject));
QV4::Scoped<CallContext> wrapperContext(valueScope, wrapper->context());
diff --git a/src/qml/qml/qqmlcontextwrapper.cpp b/src/qml/qml/qqmlcontextwrapper.cpp
index 712cba74ec..f73548100d 100644
--- a/src/qml/qml/qqmlcontextwrapper.cpp
+++ b/src/qml/qml/qqmlcontextwrapper.cpp
@@ -53,8 +53,8 @@ using namespace QV4;
DEFINE_OBJECT_VTABLE(QmlContextWrapper);
-Heap::QmlContextWrapper::QmlContextWrapper(QV8Engine *engine, QQmlContextData *context, QObject *scopeObject, bool ownsContext)
- : Heap::Object(QV8Engine::getV4(engine))
+Heap::QmlContextWrapper::QmlContextWrapper(QV4::ExecutionEngine *engine, QQmlContextData *context, QObject *scopeObject, bool ownsContext)
+ : Heap::Object(engine)
, readOnly(true)
, ownsContext(ownsContext)
, isNullWrapper(false)
@@ -70,18 +70,16 @@ Heap::QmlContextWrapper::~QmlContextWrapper()
context->destroy();
}
-ReturnedValue QmlContextWrapper::qmlScope(QV8Engine *v8, QQmlContextData *ctxt, QObject *scope)
+ReturnedValue QmlContextWrapper::qmlScope(ExecutionEngine *v4, QQmlContextData *ctxt, QObject *scope)
{
- ExecutionEngine *v4 = QV8Engine::getV4(v8);
Scope valueScope(v4);
- Scoped<QmlContextWrapper> w(valueScope, v4->memoryManager->alloc<QmlContextWrapper>(v8, ctxt, scope));
+ Scoped<QmlContextWrapper> w(valueScope, v4->memoryManager->alloc<QmlContextWrapper>(v4, ctxt, scope));
return w.asReturnedValue();
}
-ReturnedValue QmlContextWrapper::urlScope(QV8Engine *v8, const QUrl &url)
+ReturnedValue QmlContextWrapper::urlScope(ExecutionEngine *v4, const QUrl &url)
{
- ExecutionEngine *v4 = QV8Engine::getV4(v8);
Scope scope(v4);
QQmlContextData *context = new QQmlContextData;
@@ -89,7 +87,7 @@ ReturnedValue QmlContextWrapper::urlScope(QV8Engine *v8, const QUrl &url)
context->isInternal = true;
context->isJSContext = true;
- Scoped<QmlContextWrapper> w(scope, v4->memoryManager->alloc<QmlContextWrapper>(v8, context, (QObject*)0, true));
+ Scoped<QmlContextWrapper> w(scope, v4->memoryManager->alloc<QmlContextWrapper>(v4, context, (QObject*)0, true));
w->d()->isNullWrapper = true;
return w.asReturnedValue();
}
@@ -198,7 +196,7 @@ ReturnedValue QmlContextWrapper::get(Managed *m, String *name, bool *hasProperty
// Fall through
}
- QQmlEnginePrivate *ep = QQmlEnginePrivate::get(v4->v8Engine->engine());
+ QQmlEnginePrivate *ep = QQmlEnginePrivate::get(v4->qmlEngine());
while (context) {
// Search context properties
@@ -353,7 +351,7 @@ void QmlContextWrapper::registerQmlDependencies(ExecutionEngine *engine, const C
// Let the caller check and avoid the function call :)
Q_ASSERT(compiledFunction->hasQmlDependencies());
- QQmlEnginePrivate *ep = engine->v8Engine->engine() ? QQmlEnginePrivate::get(engine->v8Engine->engine()) : 0;
+ QQmlEnginePrivate *ep = engine->qmlEngine() ? QQmlEnginePrivate::get(engine->qmlEngine()) : 0;
if (!ep)
return;
QQmlEnginePrivate::PropertyCapture *capture = ep->propertyCapture;
@@ -400,7 +398,7 @@ ReturnedValue QmlContextWrapper::idObjectsArray()
return d()->idObjectsWrapper->asReturnedValue();
}
-ReturnedValue QmlContextWrapper::qmlSingletonWrapper(QV8Engine *v8, String *name)
+ReturnedValue QmlContextWrapper::qmlSingletonWrapper(ExecutionEngine *v4, String *name)
{
if (!d()->context->imports)
return Encode::undefined();
@@ -410,9 +408,9 @@ ReturnedValue QmlContextWrapper::qmlSingletonWrapper(QV8Engine *v8, String *name
Q_ASSERT(r.isValid());
Q_ASSERT(r.type);
Q_ASSERT(r.type->isSingleton());
- Q_ASSERT(v8);
+ Q_ASSERT(v4);
- QQmlEngine *e = v8->engine();
+ QQmlEngine *e = v4->qmlEngine();
QQmlType::SingletonInstanceInfo *siinfo = r.type->singletonInstanceInfo();
siinfo->init(e);
@@ -451,7 +449,7 @@ ReturnedValue QQmlIdObjectsArray::getIndexed(Managed *m, uint index, bool *hasPr
*hasProperty = true;
ExecutionEngine *v4 = m->engine();
- QQmlEnginePrivate *ep = v4->v8Engine->engine() ? QQmlEnginePrivate::get(v4->v8Engine->engine()) : 0;
+ QQmlEnginePrivate *ep = v4->qmlEngine() ? QQmlEnginePrivate::get(v4->qmlEngine()) : 0;
if (ep)
ep->captureProperty(&context->idValues[index].bindings);
diff --git a/src/qml/qml/qqmlcontextwrapper_p.h b/src/qml/qml/qqmlcontextwrapper_p.h
index 9dee1ef878..96c7bc9af4 100644
--- a/src/qml/qml/qqmlcontextwrapper_p.h
+++ b/src/qml/qml/qqmlcontextwrapper_p.h
@@ -68,7 +68,7 @@ namespace Heap {
struct QQmlIdObjectsArray;
struct QmlContextWrapper : Object {
- QmlContextWrapper(QV8Engine *engine, QQmlContextData *context, QObject *scopeObject, bool ownsContext = false);
+ QmlContextWrapper(ExecutionEngine *engine, QQmlContextData *context, QObject *scopeObject, bool ownsContext = false);
~QmlContextWrapper();
bool readOnly;
bool ownsContext;
@@ -91,8 +91,8 @@ struct Q_QML_EXPORT QmlContextWrapper : Object
V4_OBJECT2(QmlContextWrapper, Object)
V4_NEEDS_DESTROY
- static ReturnedValue qmlScope(QV8Engine *e, QQmlContextData *ctxt, QObject *scope);
- static ReturnedValue urlScope(QV8Engine *e, const QUrl &);
+ static ReturnedValue qmlScope(ExecutionEngine *e, QQmlContextData *ctxt, QObject *scope);
+ static ReturnedValue urlScope(ExecutionEngine *v4, const QUrl &);
static QQmlContextData *callingContext(ExecutionEngine *v4);
static void takeContextOwnership(const ValueRef qmlglobal);
@@ -110,7 +110,7 @@ struct Q_QML_EXPORT QmlContextWrapper : Object
static void registerQmlDependencies(ExecutionEngine *context, const CompiledData::Function *compiledFunction);
ReturnedValue idObjectsArray();
- ReturnedValue qmlSingletonWrapper(QV8Engine *e, String *name);
+ ReturnedValue qmlSingletonWrapper(ExecutionEngine *e, String *name);
};
diff --git a/src/qml/qml/qqmljavascriptexpression.cpp b/src/qml/qml/qqmljavascriptexpression.cpp
index 42b10ddc1a..1745a338f3 100644
--- a/src/qml/qml/qqmljavascriptexpression.cpp
+++ b/src/qml/qml/qqmljavascriptexpression.cpp
@@ -289,7 +289,7 @@ QQmlJavaScriptExpression::evalFunction(QQmlContextData *ctxt, QObject *scopeObje
QV4::ExecutionEngine *v4 = QV8Engine::getV4(ep->v8engine());
QV4::Scope scope(v4);
- QV4::ScopedObject qmlScopeObject(scope, QV4::QmlContextWrapper::qmlScope(ep->v8engine(), ctxt, scopeObject));
+ QV4::ScopedObject qmlScopeObject(scope, QV4::QmlContextWrapper::qmlScope(v4, ctxt, scopeObject));
QV4::Script script(v4, qmlScopeObject, code, filename, line);
QV4::ScopedValue result(scope);
script.parse();
@@ -322,7 +322,7 @@ QV4::ReturnedValue QQmlJavaScriptExpression::qmlBinding(QQmlContextData *ctxt, Q
QV4::ExecutionEngine *v4 = QV8Engine::getV4(ep->v8engine());
QV4::Scope scope(v4);
- QV4::ScopedObject qmlScopeObject(scope, QV4::QmlContextWrapper::qmlScope(ep->v8engine(), ctxt, qmlScope));
+ QV4::ScopedObject qmlScopeObject(scope, QV4::QmlContextWrapper::qmlScope(v4, ctxt, qmlScope));
QV4::Script script(v4, qmlScopeObject, code, filename, line);
QV4::ScopedValue result(scope);
script.parse();
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp
index c58a5494f2..883d9f7fda 100644
--- a/src/qml/qml/qqmlobjectcreator.cpp
+++ b/src/qml/qml/qqmlobjectcreator.cpp
@@ -264,7 +264,7 @@ bool QQmlObjectCreator::populateDeferredProperties(QObject *instance)
Q_ASSERT(!sharedState->allJavaScriptObjects);
sharedState->allJavaScriptObjects = valueScope.alloc(compiledData->totalObjectCount);
- QV4::ScopedObject qmlScope(valueScope, QV4::QmlContextWrapper::qmlScope(QV8Engine::get(engine), context, _scopeObject));
+ QV4::ScopedObject qmlScope(valueScope, QV4::QmlContextWrapper::qmlScope(v4, context, _scopeObject));
QV4::ScopedContext global(valueScope, valueScope.engine->rootContext());
QV4::Scoped<QV4::QmlBindingWrapper> qmlBindingWrapper(valueScope, v4->memoryManager->alloc<QV4::QmlBindingWrapper>(global, qmlScope));
// ### GC
@@ -1176,7 +1176,7 @@ QObject *QQmlObjectCreator::createInstance(int index, QObject *parent, bool isCo
ref = QV4::QObjectWrapper::wrap(v4, instance);
QV4::Scope valueScope(v4);
- QV4::ScopedObject qmlScope(valueScope, QV4::QmlContextWrapper::qmlScope(QV8Engine::get(engine), context, _scopeObject));
+ QV4::ScopedObject qmlScope(valueScope, QV4::QmlContextWrapper::qmlScope(v4, context, _scopeObject));
QV4::ScopedContext global(valueScope, valueScope.engine->rootContext());
QV4::Scoped<QV4::QmlBindingWrapper> qmlBindingWrapper(valueScope, v4->memoryManager->alloc<QV4::QmlBindingWrapper>(global, qmlScope));
// ### GC
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index 99247fc6b7..927577a9e1 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -2462,7 +2462,6 @@ QV4::PersistentValue QQmlScriptData::scriptValueForContext(QQmlContextData *pare
Q_ASSERT(parentCtxt && parentCtxt->engine);
QQmlEnginePrivate *ep = QQmlEnginePrivate::get(parentCtxt->engine);
- QV8Engine *v8engine = ep->v8engine();
QV4::ExecutionEngine *v4 = QV8Engine::getV4(parentCtxt->engine);
QV4::Scope scope(v4);
@@ -2521,7 +2520,7 @@ QV4::PersistentValue QQmlScriptData::scriptValueForContext(QQmlContextData *pare
return QV4::PersistentValue();
}
- QV4::ScopedValue qmlglobal(scope, QV4::QmlContextWrapper::qmlScope(v8engine, ctxt, 0));
+ QV4::ScopedValue qmlglobal(scope, QV4::QmlContextWrapper::qmlScope(v4, ctxt, 0));
QV4::QmlContextWrapper::takeContextOwnership(qmlglobal);
m_program->qml = qmlglobal;
diff --git a/src/qml/qml/qqmlxmlhttprequest.cpp b/src/qml/qml/qqmlxmlhttprequest.cpp
index 6fc25e58f8..6e685bcedc 100644
--- a/src/qml/qml/qqmlxmlhttprequest.cpp
+++ b/src/qml/qml/qqmlxmlhttprequest.cpp
@@ -99,7 +99,7 @@ static ReturnedValue constructMeObject(const ValueRef thisObj, QV8Engine *e)
Scope scope(v4);
ScopedObject meObj(scope, v4->newObject());
meObj->put(ScopedString(scope, v4->newString(QStringLiteral("ThisObject"))), thisObj);
- ScopedValue v(scope, QmlContextWrapper::qmlScope(e, e->callingContext(), 0));
+ ScopedValue v(scope, QmlContextWrapper::qmlScope(v4, e->callingContext(), 0));
meObj->put(ScopedString(scope, v4->newString(QStringLiteral("ActivationObject"))), v);
return meObj.asReturnedValue();
}
diff --git a/src/qml/types/qquickworkerscript.cpp b/src/qml/types/qquickworkerscript.cpp
index c1a7adf630..b822c155b6 100644
--- a/src/qml/types/qquickworkerscript.cpp
+++ b/src/qml/types/qquickworkerscript.cpp
@@ -300,7 +300,7 @@ QV4::ReturnedValue QQuickWorkerScriptEnginePrivate::getWorker(WorkerScript *scri
QV4::ExecutionEngine *v4 = QV8Engine::getV4(workerEngine);
QV4::Scope scope(v4);
- script->object = QV4::QmlContextWrapper::urlScope(workerEngine, script->source);
+ script->object = QV4::QmlContextWrapper::urlScope(v4, script->source);
QV4::Scoped<QV4::QmlContextWrapper> w(scope, script->object.value());
Q_ASSERT(!!w);
diff --git a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
index 32568215e6..cd1302e5c8 100644
--- a/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
+++ b/tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
@@ -3950,7 +3950,7 @@ void tst_qqmlecmascript::verifyContextLifetime(QQmlContextData *ctxt) {
{
QV4::Scope scope(QV8Engine::getV4((engine)));
- QV4::ScopedValue temporaryScope(scope, QV4::QmlContextWrapper::qmlScope(engine, scriptContext, 0));
+ QV4::ScopedValue temporaryScope(scope, QV4::QmlContextWrapper::qmlScope(scope.engine, scriptContext, 0));
Q_UNUSED(temporaryScope)
}