| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
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>
|
|\| | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Conflicts:
src/plugins/qmltooling/qmldbg_debugger/qv4datacollector.cpp
src/qml/jit/qv4assembler.cpp
src/qml/jit/qv4assembler_p.h
src/qml/jit/qv4isel_masm.cpp
src/qml/jsruntime/qv4context.cpp
src/qml/jsruntime/qv4context_p.h
src/qml/jsruntime/qv4engine.cpp
src/qml/jsruntime/qv4vme_moth.cpp
src/qml/memory/qv4mmdefs_p.h
Change-Id: I9966750b7cd9106b78e4c4779f12b95a481cca40
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
For timestamp comparison it is not necessary to create another
QFileInfo() object and call exists() and lastModified(), when we can
pass that information through from the type loader.
Change-Id: I225cd36e672f1f390bddb4e6ebfafa3fc1269795
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Currently we only use the runtimeStrings offset in JIT generated code,
so move that into a standard layout base class and use that instead.
Task-number: QTBUG-58666
Change-Id: Id933ba5df3a6990e89886c2b328e9e814ec5e413
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |/ /
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The current way of encoding the offsetof() of the method_ members in
QV4::Runtime is not portable when cross-compiling from a 64-bit host
(where the offsetof would be calculated on) to a 32-bit target (where
the offset would be different), or vice versa. In preparation for making
this work, this patch first replaces the direct use of the run-time
members with use through a void * and an enum for indexing. This gives
us some type-safety in some places and will also allow for a translation
of the pointer offset from host pointer indexing to target pointer
indexes.
As a bonus we can avoid going through the engine->runtime indirection in
the interpreter altogether and call the static methods right away.
Task-number: QTBUG-58666
Change-Id: I3cd6459523923a9719408317fa729bca19c2bf3c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|\| |
| | |
| | |
| | | |
Change-Id: I0ec164ce6e8099e6e4d6b40a3c7340737473ef4b
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The offset of the runtimeStrings array differed between a V4_BOOTSTRAP build
and the regular library build. This is an intermediate fix until QTBUG-58666
is fixed properly.
Change-Id: Id1310ffa82f1079c1acef7730db41186fa62610f
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Add support for specifying the output file name
Change-Id: I3ec3cecae2334a7640baa928c0739c5521496d2d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| | |
All required information is already available when creating the
CompiledData::Function, so determine at that point whether we
use a Simple or full CallContext.
Change-Id: Ife489ca2ca6eaf2ffc7843544a56e8bd86590e9d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
As we currently lack the ability to do type resolution at AOT cache
generation time, we need to re-do the work after loading the cache file,
making us essentially only re-use the code and avoiding the step of
parsing.
Change-Id: I12844692d4766345d8a313b59d21abf1f868e2d1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
Full definitions of types are needed in static_casts.
Change-Id: I028ffc40a76cdb16cb297a181b3d9dfe9d09c945
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Assign QJsonPrivate::qle_bitfield<>.val directly to initialize
it instead of using the assignment operator in classes
aggregating it, fixing errors:
qtbase/src/corelib/json/qjson_p.h: In member function 'uint QV4::Compiler::JSUnitGenerator::registerIndexedGetterLookup()':
qtbase/src/corelib/json/qjson_p.h:187:35: error: 'l.QJsonPrivate::qle_bitfield<0, 4>::val' is used uninitialized in this function [-Werror=uninitialized]
uint i = qFromLittleEndian(val);
^
compiler\qv4compiler.cpp:110:26: note: 'l' was declared here
CompiledData::Lookup l;
Disable -Wuninitialized in
QV4::Moth::InstructionSelection::callBuiltinConvertThisToObject()
and callBuiltinPopScope(), fixing errors:
In member function 'virtual void QV4::Moth::InstructionSelection::callBuiltinPopScope()':
compiler\qv4isel_moth.cpp:1188:38: error: '*((void*)& call +4)' is used uninitialized in this function [-Werror=uninitialized]
Instruction::CallBuiltinPopScope call;
^
compiler\qv4isel_moth.cpp: In member function 'virtual void QV4::Moth::InstructionSelection::callBuiltinConvertThisToObject()':
compiler\qv4isel_moth.cpp:1338:49: error: '*((void*)& call +4)' is used uninitialized in this function [-Werror=uninitialized]
Instruction::CallBuiltinConvertThisToObject call;
Task-number: QTBUG-58476
Change-Id: I3448cd8b75e9588ffb1bcc1526a56450731f1744
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| | |
Change-Id: I69b74e01dcffe82caafb7aa8495b3036afc2b933
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: Ic3f1476b87bfa7ab0c280c928e9ac97f92698336
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>
|
|
|
|
|
|
|
|
| |
After the recent data structure changes this seems appropriate to force
a cache rebuild for those following the branch in release builds.
Change-Id: Ie4c0534729a752137068b8f24beb9d15e7895c46
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|\
| |
| |
| | |
Change-Id: I19804e880005c66880eeabfaebf0b1093de80e6b
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The error is a warning upgraded via -Werror and the message doesn't even
make sense to me:
error #3373: nonstandard use of "auto" to both deduce the type from an
initializer and to announce a trailing return type
Intel-Issue-ID: 6000164202
Change-Id: I73fa1e59a4844c43a109fffd148caf09a1952e92
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|/
|
|
|
|
|
| |
Previously this required an extra shift to move the bit to the lsb.
Change-Id: I04674c3bad34d60af13728fe9a7dd120a188c26f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Import::type used to be a quint32. The switch from quint32 to quint8
changed the alignment of other structures in the compiled blob. On QNX,
the alignment isn't appropriate for some of the instructions that the
compiler uses to access/modify the structures and a BUS error occurs.
Changing Import::type to LEUInt32 puts the alignment back the way it
was before. Simpler than trying to figure out how to get everything
aligned correctly with a quint8 at the front of the structure.
Task-number: QTBUG-56341
Change-Id: Ia6f4daff5f615f9c5dbcc34ce8c3c9a89bab2b69
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>
|
|
|
|
|
|
|
|
| |
Align all fields on an 8-byte boundary to make sure there are no bus
errors or penalties for unaligned access.
Change-Id: Ia455860bb0403178882b80e1036f067666386e77
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
| |
... after the recent changes to codegen and runtime API.
Change-Id: Id6f1ebf7b0c4dfab050c7262209dbe26116b2e7b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
If we generate byte code, then we can mmap without the executable flags,
otherwise we need them. This should make things work out of the box on
platforms where special rights are needed before executable mappings are
allowed.
Change-Id: I24e663f85d661bc51cd3bf2463547b1d1590ea32
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
|
|
|
|
|
|
|
|
| |
...into a separate class. This will make it easier to specialize the
handling for Posix and Windows platforms.
Change-Id: I995538fa8239eac8586c96812086e50b4c19257f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
We currently embed the attached object ids in the generated code, which
is not stable because they come from a hash and the meta-objects of the
attached types are also not part of the check-sum verification. So for
now disable accelerated access in order to proceed with qtquickcontrols2
integrations. This needs to be re-enabled later with proper checking and
stable lookups.
Change-Id: I54a3f0c905ee26fb80f4e2687a2901a11a921b38
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
If we succeeded in saving the compilation unit to disk, then attempt to use it
right away. This replaces the C++ heap usage for the compilation unit data as
well as the anonymous allocated executable memory with file-backed mmap'ed
memory. That means the memory can be discarded when overall availability is low
and paged in on-demand.
Change-Id: Ide1b1e11752d861eb049a99a26ca12cec5e2502e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
| |
Make sure to save the .qmlc/.jsc files to the location
determined by the file selectors.
Change-Id: If535bb1e4f0d20ac692b3d8e6d563f77cd00446b
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When loading a QML component from the disk cache, compare the checksum
of the dependent types against the checksum when the cache was created.
Any change in the meta-object of a dependent type should trigger a
re-creation discard of the cache and consequent re-creation (in the
test-case).
Unfortunately this also requires extending the existing hack in the unit
test to deal with the low second precision on HFS+ in order to pass the
tests.
Change-Id: Ib8e899347680f7be676788388e9c23a09b0277e3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
| |
When running on a big-endian system, we need to convert the constant values
into big-endian once and then it's possible to access them directly.
Change-Id: I655bad7b7734e3b95e79e5f688f0b4041d0c41c4
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
| |
Change-Id: Icd5b1d805059981cbbb4c0eb2a5c842d59223839
Reviewed-by: Ulf Hermann <ulf.hermann@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>
|
|
|
|
|
|
|
|
| |
Perform various basic checks before proceeding to load an existing cache file,
including the qt version, architecture, data structure version and others.
Change-Id: Ie822b056e944ac120643aad260e97f62616688bf
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of relying on two time stamps in the file system (source file and cache
file), make the determination on whether the source file is newer than the
cache solely depend on the time stamp of only the source file. This means that
when cache files are stored in archives for example their modification date
does not need to be preserved upon extraction.
Change-Id: I0b4362663868c6fb9bd7e106028161b2d67274d4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
| |
This remains hidden behind the QML_DISK_CACHE flag until all backends
support it and the verification code is in place.
Change-Id: Ic77c64e20a2dc4c43473c47640e09f8070237e85
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
| |
Commit be491913c036b148cd4f90fa0132e269a507dbad regressed the build with some
compilers that complained that the RegExp fields were uninitialized. Fix is
the same as for the Lookup class.
Change-Id: Ie6b2adf14496d75845f6a9d9b8fc680e61aa1155
Reviewed-by: BogDan Vatra <bogdan@kdab.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
| |
Make sure all the sturcture fileds are aligned
Change-Id: I6f6dad67262e50026f7e86320bcd818a478ebc35
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There are currently two places where we calculate the total size of a
CompiledData::Unit including all of its data, once in its calculateSize()
function and then when constructing the Unit itself. This is error prone when
trying to do changes to the layout, as two places need to be adjusted. Instead
we can centralize the populating of the entire CompiledData::Unit header, the
calculation of the various offsets as well as the entire size in one shot in a
new generateHeader function. Afterwards we can allocate the final amount of
memory and copy the remaining bytes across and assemble the final data
structure.
Change-Id: Ic26d7812e59d2bee2f45cd72742e3195a56950df
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
| |
The table for referencing the inner functions is not needed. This also allows
making the function offsets table a local variable.
Change-Id: I3f1a1d6ab8c4f417edeafdc174e5b41d2d2b611b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The goal is to make the compiled data structures persistent on disk. In order
to make it possible to create these data structures on a "host" system that may
have a different endianness than the target system, we now make all the word
sized fields little-endian. The template wrappers from QJson provide
zero-overhead access for little-endian machines (the vast majority) while
maintaining a large degree of source compatibility.
Change-Id: I3d30da1fcf3bffb98dbe9337d3a35482fb7b57c8
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Store the line and column in CompiledData::Location as unsigned values.
The qmlSourceCoordinate() function(s) already now act as normalizers,
mapping values <= 0 to 0 as indicator for a missing/invalid line/column.
Valid values start at 1 and therefore there is no need to store negative
values in the location structure.
Coincidentally this also fixes a bunch of warnings about conversions from
signed to unsigned.
Change-Id: Ic69ff395d4991989aede695f2e8c58903f1bd2bf
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
The type validation is something that works on the final compilation
unit, so it can be done separately. The same applies to the composite
type registration and object/binding calculation. Both steps will
be shared with compilation units loaded from disk.
Change-Id: I43636d7ac76077c76289d7c1c9eba5e9c6b8239a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
| |
Hidden behind a QML_DISK_CACHE=1 environment variable we will now attempt to
save a binary representation of the type compilation for Foo.qml next to it called
Foo.qmlc.
Change-Id: I27e800b50cdb186669256fd277578ea1f1e70513
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
The code to update the counters operates entirely on data structures
from CompilationUnit, so it makes sense to move it into that class.
Plus - you guessed it - this will also be called when not using the type
compiler in the future.
Change-Id: I644b0914980b799be1020ed74d2791b127bbcf9f
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>
|
|
|
|
|
|
|
|
| |
These interfaces are required in order to be able to use the
QQmlPropertyCacheCreator template.
Change-Id: I371e7102aac00fd607fc6a8ad7ffc18996608758
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>
|
|
|
|
|
|
|
|
|
|
| |
For loading compilation units from disk we'll have to scan the unit for type
references, in order to correctly load dependencies. In preparation for that
this patch template'izes the loops so that they can work on the Qml IR as well
as on the CompiledData::Object structures.
Change-Id: I32e4e3277e16c5a2d1bf6baf24456c9837c189ff
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|