diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2023-12-22 14:06:34 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2024-01-10 11:22:43 +0100 |
commit | 47ddbb72e052989622f5fa23e032c787bed5f2e5 (patch) | |
tree | 6c18a31045527b7b43be331651607ac34908639a /src/qml/jsruntime/qv4executablecompilationunit_p.h | |
parent | be6d1499af75228341227d15441284e07cfe1e41 (diff) |
QtQml: Get rid of the module mutex
It only exists so that the type loader can query pre-compiled and native
modules from the loader thread. However, the type loader already has a
mutex of its own. We can use that to inject a "native" blob into its
script cache for the same effect.
We need to get rid of the mutex so that we can use the module map for
other compilation units, too.
Change-Id: I5a9c266ea36b50f5ea69214110def644f7501674
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Diffstat (limited to 'src/qml/jsruntime/qv4executablecompilationunit_p.h')
-rw-r--r-- | src/qml/jsruntime/qv4executablecompilationunit_p.h | 30 |
1 files changed, 4 insertions, 26 deletions
diff --git a/src/qml/jsruntime/qv4executablecompilationunit_p.h b/src/qml/jsruntime/qv4executablecompilationunit_p.h index 69cac2974c..4f79f12030 100644 --- a/src/qml/jsruntime/qv4executablecompilationunit_p.h +++ b/src/qml/jsruntime/qv4executablecompilationunit_p.h @@ -109,29 +109,8 @@ public: QString finalUrlString() const { return m_compilationUnit->finalUrlString(); } QString fileName() const { return m_compilationUnit->fileName(); } - // url() and fileName() shall be used to load the actual QML/JS code or to show errors or - // warnings about that code. They include any potential URL interceptions and thus represent the - // "physical" location of the code. - // - // finalUrl() and finalUrlString() shall be used to resolve further URLs referred to in the code - // They are _not_ intercepted and thus represent the "logical" name for the code. - - QUrl url() const - { - if (!m_url.isValid()) - m_url = QUrl(m_compilationUnit->fileName()); - return m_url; - } - - QUrl finalUrl() const - { - if (!m_finalUrl.isValid()) - m_finalUrl = QUrl(m_compilationUnit->finalUrlString()); - return m_finalUrl; - } - - mutable QQmlNullableValue<QUrl> m_url; - mutable QQmlNullableValue<QUrl> m_finalUrl; + QUrl url() const { return m_compilationUnit->url(); } + QUrl finalUrl() const { return m_compilationUnit->finalUrl(); } // QML specific fields QQmlPropertyCacheVector propertyCaches; @@ -243,10 +222,10 @@ public: return qmlData()->objectAt(index); } - int importCount() const { return qmlData()->nImports; } + int importCount() const { return m_compilationUnit->importCount(); } const CompiledData::Import *importAt(int index) const { - return qmlData()->importAt(index); + return m_compilationUnit->importAt(index); } Heap::Object *templateObjectAt(int index) const; @@ -289,7 +268,6 @@ public: return unitData()->flags & CompiledData::Unit::IsSharedLibrary; } - QStringList moduleRequests() const; Heap::Module *instantiate(); const Value *resolveExport(QV4::String *exportName) { |