| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
We need a CompilationUnit that only holds the data needed for
compilation and another one that is executable by the runtime.
Change-Id: I704d859ba028576a18460f5e3a59f210f64535d3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The map of name IDs to resolved types so far is copied several times
during compilation and different compile passes see different copies of it.
Compile passes may add things to the map, and if they do that on copies
that are inaccessible to other code, we get nondeterministic results.
Furthermore all the copies and pointers are confusing and inefficient.
Fixes: QTBUG-69340
Change-Id: I43ad3cbeeec34f90e05570eddc901fe8aa64c709
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Store doubles in bindings in the constant table of the compilation unit
instead of each binding. This removes one of the two 8 byte members of
the value union and also allows for sharing of constants throughout a
.qml file.
Change-Id: I1d7daafdb7f24e34c14cd160d2dcb2c5aaac1c50
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We have a few places in the type loader where we do adventurous manual
reference counting, where getType() returns a raw pointer that has been
addref()'ed and then sometimes somehow we call release() later. Commit
0b394e30bba4f6bb7e6f7dbe5585a2e15aa0f21d is an example of where this can
easily go wrong. As a consequence and also in preparation for future
work on the type loader, this patch starts replacing the manual
reference counting there.
Changing the return type from QQmlTypeData *getType() to a
QQmlRefPointer<> itself is not sufficient though, as the implicit
operator T*() will still allow the caller to store the result as a raw
pointer. Therefore this patch removes the "unsafe" implicit extraction
operator.
As a result of that change, other types that are sometimes stored in
QQmlRefPointer are also affected and their usage needs to be adapted
to QQmlRefPointer usage or manual raw pointer extraction with .data().
Change-Id: I18fd40634047f13196a237f4e6766cbef3bfbea2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When declaring bindings within a group property and that group property
itself is a locally declared alias, then by the time we try to determine
property caches for the group property we will fail as the aliases
haven't been resolved yet.
To fix this we can keep track of such group property declarations
(encapsulated in the QQmlInstantiatingBindingContext that has all we
need) and after we've resolved the aliases (added them to the property
caches), we can go back and fill in the entries in the propertyCaches
array for the group properties.
Task-number: QTBUG-51043
Change-Id: I5613513db3977934bcc51a3df530de47d57326f9
Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
Reviewed-by: Michael Brasser <michael.brasser@live.com>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/qml/compiler/qv4codegen.cpp
src/qml/compiler/qv4compileddata.cpp
src/qml/compiler/qv4compileddata_p.h
src/qml/compiler/qv4isel_moth_p.h
src/qml/compiler/qv4ssa.cpp
src/qml/jit/qv4assembler_p.h
src/qml/jit/qv4isel_masm_p.h
src/qml/jit/qv4regalloc.cpp
src/qml/jsruntime/qv4engine.cpp
src/qml/jsruntime/qv4qmlcontext_p.h
src/qml/jsruntime/qv4regexp.cpp
src/qml/jsruntime/qv4regexp_p.h
src/qml/jsruntime/qv4regexpobject.cpp
src/qml/jsruntime/qv4runtime.cpp
src/qml/jsruntime/qv4vme_moth.cpp
src/qml/qml/v8/qqmlbuiltinfunctions.cpp
tests/auto/qml/qml.pro
tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp
tools/qmlcachegen/qmlcachegen.cpp
Change-Id: I1577e195c736f3414089036b957a01cb91a3ca23
|
| |\
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
src/qml/compiler/qv4compileddata.cpp
src/qml/compiler/qv4compileddata_p.h
src/qml/jsruntime/qv4engine.cpp
src/qml/jsruntime/qv4qmlcontext.cpp
src/qml/jsruntime/qv4qmlcontext_p.h
src/qml/jsruntime/qv4regexpobject.cpp
src/qml/jsruntime/qv4regexpobject_p.h
src/qml/types/qqmllistmodel.cpp
src/quick/items/qquickanimatedimage_p.h
src/quick/scenegraph/qsgrenderloop.cpp
tests/auto/qml/qmlcachegen/tst_qmlcachegen.cpp
Change-Id: If20ef62b2c98bdf656cb2f5d27b1897b754d3dc0
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is a follow-up to the parent commit to remove the variable that
is really a constant (zero).
Change-Id: I8fc20027c5c7b871269b814cb8b93636e94be267
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| | |
Fold the stuff from IR::Function into QQmlJS::Context, and
add a QQmlJS::Module class to replace the last pieces of the old
IR.
Change-Id: Ic02a6738a4f1db67a0ddf97b6c93ca32be81789d
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|/
|
|
|
|
|
|
|
| |
[ChangeLog][QtQml] Support C++11 scoped enums in QML. These can now be
accessed as <TypeName>.<EnumName>.<EnumValue>
Change-Id: I29bd3f16e980f3e6f1b2390b5a8e9e8e999952a3
Task-number: QTBUG-54961
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
Similar to the Qt Quick Compiler we need to do the expression
simplification pass at cache generation time to extract translation
calls in list elements.
Change-Id: I267fc9647ab82bc83d6b087c06c0036df38238ff
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/qml/compiler/qqmltypecompiler.cpp
src/qml/compiler/qqmltypecompiler_p.h
src/qml/qml/qqmltypeloader.cpp
src/qml/qml/qqmltypeloader_p.h
Change-Id: I4894555ab7a0879b56bbda7a46d16d1c40c19e7c
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Instead of passing the engine parameter all the way through the data
structure generator, along with the dependent type data structure that
is unused otherwise, let's simply provide a function object for the
dependency hashing.
This is also in preparation for adding singleton types to the dependency
hash.
Task-number: QTBUG-58486
Change-Id: I5bb5e5c06b7b5c77195cec3da13141333cfea7a8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This better reflects what it is, and especially removes some confusion in
QQmlTypeCompiler which has a m_importCache member (of type QQmlImports),
which lead to some strange-to-read things like this:
m_importCache.populateCache(*importCache);
Which is now:
m_importCache.populateCache(*typeNameCache);
Change-Id: I7590dd1ba71ca77a8d964250a0d517156b723f8e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We use an MD5 checksum over the meta-object data to verify that the
types a QML file depends on haven't changed since the cache was
generated. However when the dependent types are QML types, then the
meta-object data contains dynamically generated type names such as
QMLTYPE_1234, which is non-deterministic. To address this, we resort to
the checksum over the meta-object data only for C++ types (if those
change it's likely an incompatible change) and for QML types use the
fact that all the information about the QML declared types comes from
the QML file only, which means we can in that case simply use a checksum
over the QV4::CompiledData memory chunk.
In addition we need to ensure that the generated CompiledData memory chunk
is deterministic by avoiding any uninitialized bytes (memset) and using
a map instead of a hash for the mapping of object index to object id.
Task-number: QTBUG-55926
Change-Id: I27c840b1960ad36b486198e504b70989c22a3972
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
|
|
|
| |
The class is a candidate for further functionality, it doesn't have
to be nested in CompilationUnit.
Change-Id: I100553160f5ae34f66b9f8ff5df9f636da2ffb67
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Similar to the regular property cache creation code, this also has to become a
template function so that it can be run on the compilation units loaded from
disk in the future. What is shared between the code path of a fresh compilation
vs. re-use of a unit from disk is the code to propagate the CompiledData::Alias
entries into entries in the property cache. The code for iterating through the
component spaces and resolving the alias references is not shared.
Change-Id: I04c2a5575310400156b457ae7b709cffecb7455e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
The resolution of aliases needs to to be solved in iterations as an alias can
refer to another alias, which may not be created yet in the property cache by
the time we try to perform the resolution. Therefore the alias resolution code
works off a list of pending aliases after the initial pass of resolution. This
also requires the ability to detect circular references.
Change-Id: Id4e159b9c713aa8a8a095759e22e3fac456a38a0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When assigning an object to a property that is a QQmlComponent, we implicitly
"wrap" a Component {} around the object declaration. In the QML IR this is only
half-heartedly represented. In order to correctly determine dependencies later
when saving and to support QML files that use implicit components but don't
import QtQml or QtQuick explicitly, we must also extend the file imports
accordingly. This is now done (and tested) by emulating a "import QtQml 2.0 as
QmlInternals" and then using "QmlInternals.Component".
Change-Id: I26f4f53a35675b52d4bd39f23359b0ac8f9678c5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
The code reads mostly from QQmlTypeData internal data structures, so
it's cleaner to move it there - we can remove the getters for these
internal fields. And it also allows for re-use later when not using the
type compiler.
Change-Id: I36cfaf3f1cecd6c8b223ee08516884a07bc60d6c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
| |
The type compiler file is getting crowded and this class is destined
to be used outside of the scope of the type compiler.
Change-Id: I21aff8ee64dbfeb039523518e912ef206637fb41
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
| |
Instead we can get most of the data from QV4::CompilationUnit - which
is always ready at that point in time. And errors are now returned
explicitly in the API.
Change-Id: I6acbeb550661f88f7fad09e97f78a1a4cbd77568
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
| |
This is in preparation for future use beyond the type compiler when
loading compilation units off disk.
Change-Id: Ic1ea89518cec32b336153ecf32641fc7f8b7db0c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
| |
The QQmlCustomParser already has an imports bi-pointer, so there's no
need for the property validator to implement an interface anymore.
Change-Id: Iabe9810ff26afdbc0c51efde3b20383c8f4f2348
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
| |
This will allow the use of it also against a QV4::CompilationUnit and assorted
data structures loaded from the disk.
Change-Id: I4f337d1fcf319e80e422448671476db907de6d9e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
| |
By not depending on QQmlCompilePass the code will be re-usable also
outside of the type compiler in the future.
Change-Id: I55c637886cf557d6d130c4f9325d6b0790cb2806
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
As part of removing the QQmlTypeCompiler dependency, the property cache
vector output of the creator is now passed explicitly as an out
parameter to the constructor.
Similarly the error handling is made explicit in the API instead of
implicitly passing any generated errors to the QQmlTypeCompiler.
Change-Id: Ia3013011518f59f57f2eecb526f64dec7d82cb91
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
| |
Replace the direct linked list object traversal with iterators. This
will allow for re-use of the code against the QV4::CompiledData
structures when they get the same interface.
Change-Id: I901fd3377ef0f0317e5d9278cface37d80f93abf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
| |
Changed the QList<QmlIR::Object*> for IR object storage to use a QVector
instead, to secure the guarantee of contiguous storage in memory. This will
later be useful for direct indexing.
Change-Id: I3c0a5f2c346627c8436971ec1d69160865eeb22e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The QQmlPropertyCacheVector in the CompilationUnit encapsulates the
property caches for the objects declared in the QML tree as well as the
bits indicating whether a VME meta-object is needed. The ref-counting
for the caches in that vector was done "manually" and thus error prone.
This patch replaces the vector with a wrapper container that has
explicit move semantics and takes care of the addref() and release()
calls upon insertion, replacement and destruction.
Change-Id: If805fe016f1a1c70e56f8a90909ab87b653ea026
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Reduce the complexity of the recursive tree traversal by moving
the base type property cache creation into a helper function and using a
context to encapsulate the origin of the current traversal
* ensureVMEMetaObject() had only one call site and it's easiest to
inline that for now.
* Transition to a new state-less error handling, so that in the future
this code can be used without the QQmlTypeCompiler dependency, which
will be needed for loading of compilation units from disk.
* A few missing consts.
Change-Id: Ibe7209c357a3c7e101fac6960ece40a033e55f72
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
| |
Separate out the property cache creation code into a standalone file.
Change-Id: Ib67bb1ef72c3de70ebd1ca8cae41947cbad7bfe3
Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
|
|
|
|
|
| |
Change-Id: I668c829bf04e0e16ed94db169507cc5290deec50
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
| |
QQmlCompiledData used to contain the binary data for instantiating QML types in
the QML VME. Nowadays the QML type compiler as well as the JavaScript compiler
create a QV4::CompiledData::CompilationUnit.
Change-Id: I155f62a5ecfb55a3fe230520231b6d8fd5b28ac9
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
|
|
|
|
|
| |
Change-Id: I99bb37bf4d4aa4aedd8e02a0fb4afb4a908573a6
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
| |
Change-Id: I77892919678cb01ba1e697a44122760679a72045
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
|
|
|
|
|
|
|
|
|
| |
This makes particularly sense as the binding property data per object that
allows us to avoid a by-name property lookup when instantiating types is also
stored there.
Change-Id: I4d9275c1d8fde252df83eb11a9dfea71e5e9583a
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
|
|
|
|
|
|
|
|
|
| |
Similary to the other hash tables we can store the actual information about
whether a binding is covered by a custom parser or not straight in the
CompiledData::Binding.
Change-Id: Iab9044af57338cec935d3ef38764d7dc1aa507e8
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Ultimately the decision which bindings to initialize in a deferred way depends
on the data in the meta-object (deferred property names entry). The hash in
QQmlCompiledData is just caching this information. We are better off storing
this single bit right in the binding itself instead of in a parallel data
structure.
Change-Id: Ib66d3550210af1f882b98b0ba9089391813d69ad
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
| |
After the removal of the named object hash tables in the persistent compilation
unit data, we can also eliminate them from the temporary internal type
compilation structures. We have everything we need in the object naming table
in the CompiledData::Object - the only thing missing are the component roots.
Change-Id: Ia2a7b3894310cfdb5cfecf1c2a921fb51e2a883b
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Ids and aliases that refer to their target by id are bound to the scope of
components. Instead of determining this boundary through a binary search for
bindings that refer to the inner object, we can simply query the flags of the
component object itself as to when to stop. This is based on the assumption
that a component has only one binding anyway.
Change-Id: I9a555ca95f8274b6d9a98793a2c946f47348f9d4
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
By storing the object indices of named objects in the CompiledData::Object of a component,
we can achieve two things:
(1) We can eliminate the hash of vectors in QQmlCompiledData for the object-to-id mapping
(2) We can store the mapping from object name to integer object id in the CompilationUnit and
share it across different QQmlContextData instances (as long as it is not modified).
Also added a new test that verifies the functionality of a .qml file starting
with Component{} itself with object names, something that was previously only
implicitly tested through some of the examples (corkboards.qml for example).
Change-Id: I28c70217222dc0e5252bf5247b7e3fc4def47446
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
|
|
|
|
|
|
|
|
|
| |
By storing the calculated integer id for an id-named object in
CompiledData::Object we can simplify the code and replace a hash table with a
plain vector.
Change-Id: I4a84cdd00e98766d603d152e5a6574b232771a02
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
|
|
|
|
|
|
|
|
| |
This allows simplifying some code and reducing the usage of the objectIndexToId
hash maps.
Change-Id: I1f08d4b224c4f9fa498d90471fa545ae4e4f2af4
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
| |
It is unused now and we can remove it as well as its QByteArray based storage.
The non-emptyness of the meta-data QByteArray was also used to indicate whether
it is necessary to create a VME meta-object when instantiating an object. This
bit is now folded into the flag of the QFlagPointer storing the property
caches.
Change-Id: I3c3604c61ff16a4e76912e68b1c19afdb0f2bd9d
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace substring functions that return QString with
corresponding functions that return QStringRef where
it's possible.
Create QString from QStringRef only where necessary.
While touching the code, also port loops to C++11 style.
Change-Id: I04c99b24ea6afd3715e3edf9ea00bfab838fd53c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Frank Meerkoetter <frank.meerkoetter@basyskom.com>
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
|
|\
| |
| |
| |
| |
| |
| | |
Conflicts:
src/plugins/qmltooling/qmldbg_native/qmldbg_native.pro
Change-Id: I3ca8f0422828191b7e19539c25f31f2d048e9f18
|
| |
| |
| |
| |
| |
| | |
Task-number: QTBUG-46758
Change-Id: I14e394021c231bda5552c8d1c98f20c903a62f12
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
|
|/
|
|
|
|
|
|
|
|
|
| |
From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see
http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/
Updated license headers to use new LGPL header instead of LGPL21 one
(in those files which will be under LGPL v3)
Change-Id: Ic36f1a0a1436fe6ac6eeca8c2375a79857e9cb12
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
|
|
|
|
|
|
|
|
| |
Change-Id: Ic06af4805da987dd08e361f2668e7a1788d3eefe
Task-number: QTBUG-43581
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
|