aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2017-08-23 13:48:07 +0200
committerSimon Hausmann <simon.hausmann@qt.io>2017-08-23 13:48:29 +0200
commit51763b1b191c0839ea05c75855b9e09b65b80546 (patch)
tree113c4b4328ddecd07c8cff2ac19cea6f2aec0ba2 /src
parent2b7b24a0e039a18db8ab23475fbab44718f758a2 (diff)
parent363189a3d351ace484180ede0f2f6c4ed04f8401 (diff)
Merge remote-tracking branch 'origin/5.9' into dev
Conflicts: tests/auto/qml/debugger/qqmlenginedebuginspectorintegrationtest/tst_qqmlenginedebuginspectorintegration.cpp Change-Id: I31375151eb239f348bec988d2d0506c2b4d9604c
Diffstat (limited to 'src')
-rw-r--r--src/qml/compiler/qv4compileddata.cpp15
-rw-r--r--src/qml/compiler/qv4compileddata_p.h3
-rw-r--r--src/qml/compiler/qv4jsir.cpp1
-rw-r--r--src/qml/qml/qqmlcontext.cpp2
-rw-r--r--src/qml/qml/qqmlcontext_p.h5
-rw-r--r--src/qml/qml/qqmlengine_p.h6
-rw-r--r--src/qml/qml/qqmlincubator.cpp11
-rw-r--r--src/qml/qml/qqmlobjectcreator.cpp9
-rw-r--r--src/qml/qml/qqmlobjectcreator_p.h5
-rw-r--r--src/qml/qml/qqmlproperty.cpp2
-rw-r--r--src/qml/qml/qqmltypeloader.cpp2
-rw-r--r--src/qml/qml/qqmlvmemetaobject.cpp3
-rw-r--r--src/qmltest/quicktest.cpp5
-rw-r--r--src/quick/scenegraph/qsgthreadedrenderloop.cpp1
-rw-r--r--src/quick/scenegraph/util/qsgatlastexture.cpp7
-rw-r--r--src/quick/scenegraph/util/qsgatlastexture_p.h2
16 files changed, 43 insertions, 36 deletions
diff --git a/src/qml/compiler/qv4compileddata.cpp b/src/qml/compiler/qv4compileddata.cpp
index 96b76d8cfd..6b20557076 100644
--- a/src/qml/compiler/qv4compileddata.cpp
+++ b/src/qml/compiler/qv4compileddata.cpp
@@ -97,6 +97,7 @@ static QString cacheFilePath(const QUrl &url)
CompilationUnit::CompilationUnit()
: data(0)
, engine(0)
+ , qmlEngine(0)
, runtimeLookups(0)
, runtimeRegularExpressions(0)
, runtimeClasses(0)
@@ -211,8 +212,8 @@ void CompilationUnit::unlink()
if (isRegisteredWithEngine) {
Q_ASSERT(data && quint32(propertyCaches.count()) > data->indexOfRootObject && propertyCaches.at(data->indexOfRootObject));
- if (engine)
- QQmlEnginePrivate::get(engine)->unregisterInternalCompositeType(this);
+ if (qmlEngine)
+ qmlEngine->unregisterInternalCompositeType(this);
QQmlMetaType::unregisterInternalCompositeType(this);
isRegisteredWithEngine = false;
}
@@ -229,6 +230,7 @@ void CompilationUnit::unlink()
resolvedTypes.clear();
engine = 0;
+ qmlEngine = 0;
free(runtimeStrings);
runtimeStrings = 0;
delete [] runtimeLookups;
@@ -258,9 +260,6 @@ void CompilationUnit::markObjects(QV4::MarkStack *markStack)
void CompilationUnit::destroy()
{
- QQmlEngine *qmlEngine = 0;
- if (engine && engine->v8Engine)
- qmlEngine = engine->v8Engine->engine();
if (qmlEngine)
QQmlEnginePrivate::deleteInEngineThread(qmlEngine, this);
else
@@ -283,12 +282,14 @@ IdentifierHash<int> CompilationUnit::namedObjectsPerComponent(int componentObjec
return *it;
}
-void CompilationUnit::finalize(QQmlEnginePrivate *engine)
+void CompilationUnit::finalizeCompositeType(QQmlEnginePrivate *qmlEngine)
{
+ this->qmlEngine = qmlEngine;
+
// Add to type registry of composites
if (propertyCaches.needsVMEMetaObject(data->indexOfRootObject)) {
QQmlMetaType::registerInternalCompositeType(this);
- engine->registerInternalCompositeType(this);
+ qmlEngine->registerInternalCompositeType(this);
} else {
const QV4::CompiledData::Object *obj = objectAt(data->indexOfRootObject);
auto *typeRef = resolvedTypes.value(obj->inheritedTypeNameIndex);
diff --git a/src/qml/compiler/qv4compileddata_p.h b/src/qml/compiler/qv4compileddata_p.h
index 6ad53fca4f..cc4a96d5c0 100644
--- a/src/qml/compiler/qv4compileddata_p.h
+++ b/src/qml/compiler/qv4compileddata_p.h
@@ -868,6 +868,7 @@ struct Q_QML_PRIVATE_EXPORT CompilationUnit : public CompilationUnitBase, public
#ifndef V4_BOOTSTRAP
ExecutionEngine *engine;
+ QQmlEnginePrivate *qmlEngine; // only used in QML environment for composite types, not in plain QJSEngine case.
QString fileName() const { return data->stringAt(data->sourceFileIndex); }
QUrl url() const { if (m_url.isNull) m_url = QUrl(fileName()); return m_url; }
@@ -897,7 +898,7 @@ struct Q_QML_PRIVATE_EXPORT CompilationUnit : public CompilationUnitBase, public
// pointers either to data->constants() or little-endian memory copy.
const Value* constants;
- void finalize(QQmlEnginePrivate *engine);
+ void finalizeCompositeType(QQmlEnginePrivate *qmlEngine);
int totalBindingsCount; // Number of bindings used in this type
int totalParserStatusCount; // Number of instantiated types that are QQmlParserStatus subclasses
diff --git a/src/qml/compiler/qv4jsir.cpp b/src/qml/compiler/qv4jsir.cpp
index 5a58380005..0b0ed391fb 100644
--- a/src/qml/compiler/qv4jsir.cpp
+++ b/src/qml/compiler/qv4jsir.cpp
@@ -360,6 +360,7 @@ Function::Function(Module *module, Function *outer, const QString &name)
, insideWithOrCatch(0)
, hasDirectEval(false)
, usesArgumentsObject(false)
+ , usesThis(false)
, isStrict(false)
, isNamedExpression(false)
, hasTry(false)
diff --git a/src/qml/qml/qqmlcontext.cpp b/src/qml/qml/qqmlcontext.cpp
index 1476c276f4..531d9ae457 100644
--- a/src/qml/qml/qqmlcontext.cpp
+++ b/src/qml/qml/qqmlcontext.cpp
@@ -523,7 +523,7 @@ QQmlContextData::QQmlContextData()
QQmlContextData::QQmlContextData(QQmlContext *ctxt)
: parent(0), engine(0), isInternal(false), ownedByParent(false), isJSContext(false),
isPragmaLibraryContext(false), unresolvedNames(false), hasEmittedDestruction(false), isRootObjectInCreation(false),
- publicContext(ctxt), activeVMEData(0), componentObjectIndex(-1),
+ publicContext(ctxt), incubator(0), componentObjectIndex(-1),
contextObject(0), childContexts(0), nextChild(0), prevChild(0),
expressions(0), contextObjects(0), contextGuards(0), idValues(0), idValueCount(0), linkedContext(0),
componentAttached(0)
diff --git a/src/qml/qml/qqmlcontext_p.h b/src/qml/qml/qqmlcontext_p.h
index 4d2bb72352..a259fd62d8 100644
--- a/src/qml/qml/qqmlcontext_p.h
+++ b/src/qml/qml/qqmlcontext_p.h
@@ -78,6 +78,7 @@ class QQmlExpression;
class QQmlExpressionPrivate;
class QQmlJavaScriptExpression;
class QQmlContextData;
+class QQmlIncubatorPrivate;
class QQmlContextPrivate : public QObjectPrivate
{
@@ -145,8 +146,8 @@ public:
quint32 dummy:25;
QQmlContext *publicContext;
- // VME data that is constructing this context if any
- void *activeVMEData;
+ // The incubator that is constructing this context if any
+ QQmlIncubatorPrivate *incubator;
// Compilation unit for contexts that belong to a compiled type.
QQmlRefPointer<QV4::CompiledData::CompilationUnit> typeCompilationUnit;
diff --git a/src/qml/qml/qqmlengine_p.h b/src/qml/qml/qqmlengine_p.h
index da8ea24ea0..fd74a233a4 100644
--- a/src/qml/qml/qqmlengine_p.h
+++ b/src/qml/qml/qqmlengine_p.h
@@ -204,7 +204,7 @@ public:
template<typename T>
inline void deleteInEngineThread(T *);
template<typename T>
- inline static void deleteInEngineThread(QQmlEngine *, T *);
+ inline static void deleteInEngineThread(QQmlEnginePrivate *, T *);
QString offlineStorageDatabaseDirectory() const;
// These methods may be called from the loader thread
@@ -359,10 +359,10 @@ Delete \a value in the \a engine thread. If the calling thread is the engine
thread, \a value will be deleted immediately.
*/
template<typename T>
-void QQmlEnginePrivate::deleteInEngineThread(QQmlEngine *engine, T *value)
+void QQmlEnginePrivate::deleteInEngineThread(QQmlEnginePrivate *engine, T *value)
{
Q_ASSERT(engine);
- QQmlEnginePrivate::get(engine)->deleteInEngineThread<T>(value);
+ engine->deleteInEngineThread<T>(value);
}
/*!
diff --git a/src/qml/qml/qqmlincubator.cpp b/src/qml/qml/qqmlincubator.cpp
index 54d0b240f5..6d0e4b915a 100644
--- a/src/qml/qml/qqmlincubator.cpp
+++ b/src/qml/qml/qqmlincubator.cpp
@@ -45,9 +45,6 @@
#include "qqmlmemoryprofiler_p.h"
#include "qqmlobjectcreator_p.h"
-// XXX TODO
-// - check that the Component.onCompleted behavior is the same as 4.8 in the synchronous and
-// async if nested cases
void QQmlEnginePrivate::incubate(QQmlIncubator &i, QQmlContextData *forContext)
{
QExplicitlySharedDataPointer<QQmlIncubatorPrivate> p(i.d);
@@ -64,8 +61,8 @@ void QQmlEnginePrivate::incubate(QQmlIncubator &i, QQmlContextData *forContext)
QExplicitlySharedDataPointer<QQmlIncubatorPrivate> parentIncubator;
QQmlContextData *cctxt = forContext;
while (cctxt) {
- if (cctxt->activeVMEData) {
- parentIncubator = (QQmlIncubatorPrivate *)cctxt->activeVMEData;
+ if (cctxt->incubator) {
+ parentIncubator = cctxt->incubator;
break;
}
cctxt = cctxt->parent;
@@ -152,7 +149,7 @@ void QQmlIncubatorPrivate::clear()
}
enginePriv = 0;
if (!rootContext.isNull()) {
- rootContext->activeVMEData = 0;
+ rootContext->incubator = 0;
rootContext = 0;
}
@@ -388,7 +385,7 @@ void QQmlIncubatorPrivate::cancel(QObject *object, QQmlContext *context)
return;
QQmlContextData *data = QQmlContextData::get(context);
- QQmlIncubatorPrivate *p = (QQmlIncubatorPrivate *)data->activeVMEData;
+ QQmlIncubatorPrivate *p = data->incubator;
if (!p)
return;
diff --git a/src/qml/qml/qqmlobjectcreator.cpp b/src/qml/qml/qqmlobjectcreator.cpp
index cc9cc889d0..11d090a415 100644
--- a/src/qml/qml/qqmlobjectcreator.cpp
+++ b/src/qml/qml/qqmlobjectcreator.cpp
@@ -70,14 +70,15 @@ struct ActiveOCRestorer
};
}
-QQmlObjectCreator::QQmlObjectCreator(QQmlContextData *parentContext, QV4::CompiledData::CompilationUnit *compilationUnit, QQmlContextData *creationContext, void *activeVMEDataForRootContext)
+QQmlObjectCreator::QQmlObjectCreator(QQmlContextData *parentContext, QV4::CompiledData::CompilationUnit *compilationUnit, QQmlContextData *creationContext,
+ QQmlIncubatorPrivate *incubator)
: phase(Startup)
, compilationUnit(compilationUnit)
, resolvedTypes(compilationUnit->resolvedTypes)
, propertyCaches(&compilationUnit->propertyCaches)
, sharedState(new QQmlObjectCreatorSharedState)
, topLevelCreator(true)
- , activeVMEDataForRootContext(activeVMEDataForRootContext)
+ , incubator(incubator)
{
init(parentContext);
@@ -104,7 +105,7 @@ QQmlObjectCreator::QQmlObjectCreator(QQmlContextData *parentContext, QV4::Compil
, propertyCaches(&compilationUnit->propertyCaches)
, sharedState(inheritedSharedState)
, topLevelCreator(false)
- , activeVMEDataForRootContext(0)
+ , incubator(0)
{
init(parentContext);
}
@@ -176,7 +177,7 @@ QObject *QQmlObjectCreator::create(int subComponentIndex, QObject *parent, QQmlI
if (!sharedState->rootContext) {
sharedState->rootContext = context;
- sharedState->rootContext->activeVMEData = activeVMEDataForRootContext;
+ sharedState->rootContext->incubator = incubator;
sharedState->rootContext->isRootObjectInCreation = true;
}
diff --git a/src/qml/qml/qqmlobjectcreator_p.h b/src/qml/qml/qqmlobjectcreator_p.h
index 45c14f0963..35bf96db4e 100644
--- a/src/qml/qml/qqmlobjectcreator_p.h
+++ b/src/qml/qml/qqmlobjectcreator_p.h
@@ -65,6 +65,7 @@ QT_BEGIN_NAMESPACE
class QQmlAbstractBinding;
struct QQmlTypeCompiler;
class QQmlInstantiationInterrupt;
+class QQmlIncubatorPrivate;
struct QQmlObjectCreatorSharedState : public QSharedData
{
@@ -84,7 +85,7 @@ class QQmlObjectCreator
{
Q_DECLARE_TR_FUNCTIONS(QQmlObjectCreator)
public:
- QQmlObjectCreator(QQmlContextData *parentContext, QV4::CompiledData::CompilationUnit *compilationUnit, QQmlContextData *creationContext, void *activeVMEDataForRootContext = 0);
+ QQmlObjectCreator(QQmlContextData *parentContext, QV4::CompiledData::CompilationUnit *compilationUnit, QQmlContextData *creationContext, QQmlIncubatorPrivate *incubator = 0);
~QQmlObjectCreator();
QObject *create(int subComponentIndex = -1, QObject *parent = 0, QQmlInstantiationInterrupt *interrupt = 0);
@@ -143,7 +144,7 @@ private:
const QQmlPropertyCacheVector *propertyCaches;
QExplicitlySharedDataPointer<QQmlObjectCreatorSharedState> sharedState;
bool topLevelCreator;
- void *activeVMEDataForRootContext;
+ QQmlIncubatorPrivate *incubator;
QObject *_qobject;
QObject *_scopeObject;
diff --git a/src/qml/qml/qqmlproperty.cpp b/src/qml/qml/qqmlproperty.cpp
index 21bbcadb1c..9f1955c4d6 100644
--- a/src/qml/qml/qqmlproperty.cpp
+++ b/src/qml/qml/qqmlproperty.cpp
@@ -798,7 +798,7 @@ QQmlPropertyPrivate::binding(QObject *object, QQmlPropertyIndex index)
const int coreIndex = index.coreIndex();
const int valueTypeIndex = index.valueTypeIndex();
- if (!data->hasBindingBit(coreIndex))
+ if (coreIndex < 0 || !data->hasBindingBit(coreIndex))
return 0;
QQmlAbstractBinding *binding = data->bindings;
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp
index 8721ec507a..7e298a1f2d 100644
--- a/src/qml/qml/qqmltypeloader.cpp
+++ b/src/qml/qml/qqmltypeloader.cpp
@@ -2295,7 +2295,7 @@ void QQmlTypeData::done()
}
}
- m_compiledData->finalize(enginePrivate);
+ m_compiledData->finalizeCompositeType(enginePrivate);
}
{
diff --git a/src/qml/qml/qqmlvmemetaobject.cpp b/src/qml/qml/qqmlvmemetaobject.cpp
index 67f8ec840e..dde8784eb1 100644
--- a/src/qml/qml/qqmlvmemetaobject.cpp
+++ b/src/qml/qml/qqmlvmemetaobject.cpp
@@ -643,8 +643,7 @@ int QQmlVMEMetaObject::metaCall(QObject *o, QMetaObject::Call c, int _id, void *
if (t == QV4::CompiledData::Property::Var) {
// the context can be null if accessing var properties from cpp after re-parenting an item.
QQmlEnginePrivate *ep = (ctxt == 0 || ctxt->engine == 0) ? 0 : QQmlEnginePrivate::get(ctxt->engine);
- QV8Engine *v8e = (ep == 0) ? 0 : ep->v8engine();
- if (v8e) {
+ if (ep) {
if (c == QMetaObject::ReadProperty) {
*reinterpret_cast<QVariant *>(a[0]) = readPropertyAsVariant(id);
} else if (c == QMetaObject::WriteProperty) {
diff --git a/src/qmltest/quicktest.cpp b/src/qmltest/quicktest.cpp
index f62f66170e..8cf0d2918e 100644
--- a/src/qmltest/quicktest.cpp
+++ b/src/qmltest/quicktest.cpp
@@ -277,6 +277,11 @@ int quick_test_main(int argc, char **argv, const char *name, const char *sourceD
}
#endif
+#ifdef Q_OS_ANDROID
+ if (testPath.isEmpty())
+ testPath = QLatin1String(":/");
+#endif
+
// Determine where to look for the test data.
if (testPath.isEmpty() && sourceDir) {
const QString s = QString::fromLocal8Bit(sourceDir);
diff --git a/src/quick/scenegraph/qsgthreadedrenderloop.cpp b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
index 1e5e61e43b..fb04de27d7 100644
--- a/src/quick/scenegraph/qsgthreadedrenderloop.cpp
+++ b/src/quick/scenegraph/qsgthreadedrenderloop.cpp
@@ -553,6 +553,7 @@ void QSGRenderThread::sync(bool inExpose)
if (d->renderer)
d->renderer->clearChangedFlag();
d->syncSceneGraph();
+ sgrc->endSync();
if (!hadRenderer && d->renderer) {
qCDebug(QSG_LOG_RENDERLOOP) << QSG_RT_PAD << "- renderer was created";
syncResultedInChanges = true;
diff --git a/src/quick/scenegraph/util/qsgatlastexture.cpp b/src/quick/scenegraph/util/qsgatlastexture.cpp
index d5f836a525..22f0b13f46 100644
--- a/src/quick/scenegraph/util/qsgatlastexture.cpp
+++ b/src/quick/scenegraph/util/qsgatlastexture.cpp
@@ -116,7 +116,7 @@ QSGTexture *Manager::create(const QImage &image, bool hasAlphaChannel)
Texture *t = 0;
if (image.width() < m_atlas_size_limit && image.height() < m_atlas_size_limit) {
if (!m_atlas)
- m_atlas = new Atlas(m_atlas_size, this);
+ m_atlas = new Atlas(m_atlas_size);
// t may be null for atlas allocation failure
t = m_atlas->create(image);
if (t && !hasAlphaChannel && t->hasAlphaChannel())
@@ -125,9 +125,8 @@ QSGTexture *Manager::create(const QImage &image, bool hasAlphaChannel)
return t;
}
-Atlas::Atlas(const QSize &size, QObject *parent)
- : QObject(parent)
- , m_allocator(size)
+Atlas::Atlas(const QSize &size)
+ : m_allocator(size)
, m_texture_id(0)
, m_size(size)
, m_atlas_transient_image_threshold(0)
diff --git a/src/quick/scenegraph/util/qsgatlastexture_p.h b/src/quick/scenegraph/util/qsgatlastexture_p.h
index 0bb07e8e89..3dee539547 100644
--- a/src/quick/scenegraph/util/qsgatlastexture_p.h
+++ b/src/quick/scenegraph/util/qsgatlastexture_p.h
@@ -88,7 +88,7 @@ private:
class Atlas : public QObject
{
public:
- Atlas(const QSize &size, QObject *parent);
+ Atlas(const QSize &size);
~Atlas();
void invalidate();