diff options
author | Lars Knoll <lars.knoll@qt.io> | 2017-06-22 09:44:55 +0200 |
---|---|---|
committer | Erik Verbruggen <erik.verbruggen@qt.io> | 2017-06-22 08:07:21 +0000 |
commit | 40e8109ceff8519920245a01d82357dc57639f46 (patch) | |
tree | f9ea38dba859ed4cc736fbeb4522cfe423d8ec5e /src/qml/qml | |
parent | 135b8232923e77f9b3d0ff2f928423f3ee00cdb8 (diff) |
Don't use the ISel's anymore
Move the code that generates the CompilationUnit over to Codegen,
and don't use the ISel's at all anymore when compiling JS/QML.
Change-Id: Iba89082c386c3d3fd58ac25a4651c5d39178cc5c
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Diffstat (limited to 'src/qml/qml')
-rw-r--r-- | src/qml/qml/qqmltypeloader.cpp | 15 | ||||
-rw-r--r-- | src/qml/qml/qqmltypewrapper_p.h | 1 | ||||
-rw-r--r-- | src/qml/qml/qqmlvaluetypewrapper_p.h | 1 |
3 files changed, 9 insertions, 8 deletions
diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp index e4293596d8..5917d96293 100644 --- a/src/qml/qml/qqmltypeloader.cpp +++ b/src/qml/qml/qqmltypeloader.cpp @@ -44,6 +44,7 @@ #include <private/qqmlengine_p.h> #include <private/qqmlglobal_p.h> #include <private/qqmlthread_p.h> +#include <private/qv4codegen_p.h> #include <private/qqmlcomponent_p.h> #include <private/qqmlprofiler_p.h> #include <private/qqmlmemoryprofiler_p.h> @@ -2074,10 +2075,10 @@ bool QQmlTypeData::tryLoadFromDiskCache() if (!v4) return false; - QQmlRefPointer<QV4::CompiledData::CompilationUnit> unit = v4->iselFactory->createUnitForLoading(); + QQmlRefPointer<QV4::CompiledData::CompilationUnit> unit = QQmlJS::Codegen::createUnitForLoading(); { QString error; - if (!unit->loadFromDisk(url(), m_backupSourceCode.sourceTimeStamp(), v4->iselFactory.data(), &error)) { + if (!unit->loadFromDisk(url(), m_backupSourceCode.sourceTimeStamp(), &error)) { qCDebug(DBG_DISK_CACHE) << "Error loading" << url().toString() << "from disk cache:" << error; return false; } @@ -2558,7 +2559,7 @@ void QQmlTypeData::compile(const QQmlRefPointer<QQmlTypeNameCache> &typeNameCach QString errorString; if (m_compiledData->saveToDisk(url(), &errorString)) { QString error; - if (!m_compiledData->loadFromDisk(url(), m_backupSourceCode.sourceTimeStamp(), enginePrivate->v4engine()->iselFactory.data(), &error)) { + if (!m_compiledData->loadFromDisk(url(), m_backupSourceCode.sourceTimeStamp(), &error)) { // ignore error, keep using the in-memory compilation unit. } } else { @@ -2917,12 +2918,10 @@ struct EmptyCompilationUnit : public QV4::CompiledData::CompilationUnit void QQmlScriptBlob::dataReceived(const SourceCodeData &data) { - QV4::ExecutionEngine *v4 = QV8Engine::getV4(m_typeLoader->engine()); - if (!disableDiskCache() || forceDiskCache()) { - QQmlRefPointer<QV4::CompiledData::CompilationUnit> unit = v4->iselFactory->createUnitForLoading(); + QQmlRefPointer<QV4::CompiledData::CompilationUnit> unit = QQmlJS::Codegen::createUnitForLoading(); QString error; - if (unit->loadFromDisk(url(), data.sourceTimeStamp(), v4->iselFactory.data(), &error)) { + if (unit->loadFromDisk(url(), data.sourceTimeStamp(), &error)) { initializeFromCompilationUnit(unit); return; } else { @@ -2944,7 +2943,7 @@ void QQmlScriptBlob::dataReceived(const SourceCodeData &data) QmlIR::ScriptDirectivesCollector collector(&irUnit.jsParserEngine, &irUnit.jsGenerator); QList<QQmlError> errors; - QQmlRefPointer<QV4::CompiledData::CompilationUnit> unit = QV4::Script::precompile(&irUnit.jsModule, &irUnit.jsGenerator, v4, finalUrl(), source, &errors, &collector); + QQmlRefPointer<QV4::CompiledData::CompilationUnit> unit = QV4::Script::precompile(&irUnit.jsModule, &irUnit.jsGenerator, finalUrl(), source, &errors, &collector); // No need to addref on unit, it's initial refcount is 1 source.clear(); if (!errors.isEmpty()) { diff --git a/src/qml/qml/qqmltypewrapper_p.h b/src/qml/qml/qqmltypewrapper_p.h index 730bfd6d12..d28751d10a 100644 --- a/src/qml/qml/qqmltypewrapper_p.h +++ b/src/qml/qml/qqmltypewrapper_p.h @@ -60,6 +60,7 @@ QT_BEGIN_NAMESPACE class QQmlTypeNameCache; +class QQmlType; namespace QV4 { diff --git a/src/qml/qml/qqmlvaluetypewrapper_p.h b/src/qml/qml/qqmlvaluetypewrapper_p.h index c8aac719ab..630b405c84 100644 --- a/src/qml/qml/qqmlvaluetypewrapper_p.h +++ b/src/qml/qml/qqmlvaluetypewrapper_p.h @@ -56,6 +56,7 @@ #include <private/qv4value_p.h> #include <private/qv4object_p.h> +#include <private/qqmlpropertycache_p.h> QT_BEGIN_NAMESPACE |