| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
The StaticData flag needs to be saved to disk, but removed again
afterwards so that we can free() the malloc'd data. This also allows us
to avoid copying all the data into a byte array before saving.
Change-Id: I96513f8d98acf0ea0b4514d96376b487e8444917
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
| |
This is a better fit for the method. In turn, remove all the
V4_BOOTSTRAP conditions from qv4engine_p.h and make sure we don't
include or compile it in bootstrap mode.
Change-Id: I5933b0724e561313ca20c420b83e4d70e63bddf5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|\
| |
| |
| | |
Change-Id: I2f0b4f8543a448c9acffe0932e0fd67c0b7412f4
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is straight-forward to enable, with the minor adjustment that we
need to handle the case where a global lookup is done without a calling
qml context (worker script). We don't know at compile time whether a
script will be imported directly or used as a worker script, so we have
to generate the global qml lookup instruction regardless and handle it
at run-time.
Change-Id: Ia033afa214d919d906c676498dd3eceb1c5639d8
Reviewed-by: Michael Brasser <michael.brasser@live.com>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|\|
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
.qmake.conf
src/qmltest/quicktest.cpp
tests/auto/qml/qmlcachegen/qmlcachegen.pro
Change-Id: I70e96e8817d59647f876b8b77b30cdeede8f0662
|
| |
| |
| |
| |
| |
| |
| |
| | |
This should have been enabled in the series earlier when for
QTBUG-69898.
Change-Id: Ide7507d5dcf439463c22b631d49d654624737d1f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The CompilationUnit class owns the unit data. An exception was made in
bootstrap builds, where it was up to the caller to free the memory. This
lead to cases in qmlcachegen where we didn't free the memory. This is
best fixed by unifying the behavior.
This fixes the build when using an ASAN enabled build, as the runtime
aborts after calling qmlcachegen due to "leaks".
Change-Id: I8b55b4e302a9569a1d4e09eeb488c479368b50f0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/qml/compiler/qqmltypecompiler.cpp
src/qml/compiler/qv4bytecodehandler.cpp
src/qml/compiler/qv4codegen.cpp
src/qml/compiler/qv4compileddata_p.h
src/qml/compiler/qv4compiler.cpp
src/qml/compiler/qv4instr_moth.cpp
src/qml/compiler/qv4instr_moth_p.h
src/qml/jit/qv4baselinejit.cpp
src/qml/jit/qv4baselinejit_p.h
src/qml/jsruntime/qv4function.cpp
src/qml/jsruntime/qv4vme_moth.cpp
Change-Id: I8fb4d6f19677bcec0a4593b250f2eda5ae85e3d2
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
After enabling lookups in QML files, we can remove all the code that
tries to deal with (type) compile time detection of access to id objects
and properties of the scope/context object. This also allows removing
quite a bit of run-time code paths and even byte code instructions.
Task-number: QTBUG-69898
Change-Id: I7b26d7983393594a3ef56466d3e633f1822b76f4
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|\|
| |
| |
| |
| |
| |
| | |
Conflicts:
src/qml/compiler/qv4codegen.cpp
Change-Id: I66b7db42bf208855889094ace0267326595ce03c
|
| |
| |
| |
| |
| |
| |
| |
| | |
The list of names is still suboptimal, but at least it's shared now.
Task-number: QTBUG-69898
Change-Id: I16c9839c4a1f097053b28caea894b67757972826
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: Ic13e5af7ddb92cf5988988ebe1c2b7470a5f8c1e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|/
|
|
|
|
|
|
|
|
|
| |
By default any .qrc files are filtered and QML and JS sources dropped
when generating the cache. The new QTQUICK_COMPILER_RETAINED_RESOURCES
option allows the specification of .qrc files to be kept as they are.
The source fils specified in them will be available to the application.
Change-Id: If45bcd95c29fe4b91f5817573964ff55b1db8a00
Fixes: QTBUG-72430
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Add new enum value QV4::Compiler::ContextType::ScriptImportedByQML, which
behaves exactly the same as ContextType::Global. A follow-up patch will change
the behavior slightly.
Task-number: QTBUG-69408
Change-Id: I20d27804fd1433f2229704546bcd78a0ac108c01
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is also pretty straight-forward by adding .mjs as supported
extension in the qmake and cmake support.
This also tweaks qv4engine.cpp to share the same module compilation
function across all code paths.
Change-Id: Ia0e23c78a794f2330ecf8f991ee6ea948f4ac89d
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
| |
Since the callers always end up assigning the returned unit pointer back
to the compilation unit's data member, we might as well do that inside
the function and return void instead.
Change-Id: I7a7f3e7a0c89ffe2f9474149fcf61736609b363d
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
| |
Loading those must not fail the file relocation test, so set the source
file names to empty, as we also do for .qml files.
Also added tests for all the scenarios: no embedded file paths for AOT
files but absolute paths for run-time created cache files.
Change-Id: I3fc92e89cfd0da512afeac22bd0da3e915ec46ea
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|\
| |
| |
| | |
Change-Id: I800f39ea59efd6049d3226ec27b8ecb3f6e9ae28
|
| |
| |
| |
| |
| |
| | |
Task-number: QTBUG-64024
Change-Id: If8f749ef9ec072928cb352ad7cd4dcf140b6ed53
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The check-if-supported option does not make sense anymore since the
generated output is cross-platform.
Change-Id: If7802267b51b445d2e41387d556a344616e9afc8
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Rolf Eike Beer <eb@emlix.com>
Reviewed-by: Kevin Funk <kevin.funk@kdab.com>
|
|\|
| |
| |
| |
| |
| |
| | |
Conflicts:
src/qml/qml/qqmltypeloader.cpp
Change-Id: If9874faf23e813b05ee4cf042133a528d73ba72a
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When loading a .js file without QQC, we scan the sources and use the
ScriptDirectivesCollector to extract things like .pragma library or
.import ahead of time. That information is passed on to the compilation
unit generator for serialization. When compiling .js files ahead of
time, we also used the same collector, but we forgot to save the data
into the right location before serialization, so we essentially lost the
imports. This patch fixes that by centralizing this code into the
ScriptDirectivesCollector itself.
[ChangeLog][QtQml] Fix regression with .import in .js files not working
when using CONFIG+=qtquickcompiler.
Change-Id: I5413c14b1b8bd3114a997011534fe55cdb7634aa
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
And make it an enum class. The new name fits better, as it's mainly
used to determine the type of the context when parsing. Also already
added the 'Block' value that will be needed.
Change-Id: I70d963b6a0b22db1a3c607cce6bdd2054b29e000
Reviewed-by: Simon Hausmann <simon.hausmann@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>
|
|/
|
|
|
| |
Change-Id: Iee5a5a9edc8b79649a8f43612584ecf046a9aa2c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
From now on we prefer nullptr instead of 0 to clarify cases where
we are assigning or testing a pointer rather than a numeric zero.
Also, replaced cases where 0 was passed as Qt::KeyboardModifiers
with Qt::NoModifier (clang-tidy replaced them with nullptr, which
waas wrong, so it was just as well to make the tests more readable
rather than to revert those lines).
Change-Id: I4735d35e4d9f42db5216862ce091429eadc6e65d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: I3c9e33f882358fd4cb8b1b8764bf083ddbd792b1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Fix command line option handling to allow for processing of multiple
.qrc files as input files when generating the loader.cpp file.
Task-number: QTBUG-66161
Change-Id: I1ecd40bf863c6570ccf42846106791b7f53fe432
Reviewed-by: Samuli Piippo <samuli.piippo@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/plugins/qmltooling/qmldbg_profiler/qqmlprofilerservice.cpp
src/qml/compiler/qqmlirbuilder.cpp
src/qml/compiler/qqmlirbuilder_p.h
src/qml/compiler/qqmltypecompiler.cpp
src/qml/compiler/qv4codegen.cpp
src/qml/compiler/qv4codegen_p.h
src/qml/compiler/qv4compileddata_p.h
src/qml/compiler/qv4compiler.cpp
src/qml/compiler/qv4compilercontext_p.h
src/qml/compiler/qv4isel_moth.cpp
src/qml/compiler/qv4jsir.cpp
src/qml/compiler/qv4jsir_p.h
src/qml/jit/qv4isel_masm.cpp
src/qml/jsruntime/qv4engine.cpp
src/qml/jsruntime/qv4functionobject.cpp
src/qml/jsruntime/qv4runtimecodegen.cpp
src/qml/jsruntime/qv4script.cpp
src/qml/jsruntime/qv4script_p.h
src/qml/qml/qqmltypeloader.cpp
src/quick/items/qquickanimatedimage.cpp
src/quick/items/qquickanimatedimage_p_p.h
src/quick/scenegraph/compressedtexture/qsgpkmhandler.cpp
tests/auto/qml/qmlplugindump/qmlplugindump.pro
tests/auto/qml/qmlplugindump/tst_qmlplugindump.cpp
tools/qmlcachegen/qmlcachegen.cpp
tools/qmljs/qmljs.cpp
Done-with: Shawn Rutledge <shawn.rutledge@qt.io>
Done-with: Lars Knoll <lars.knoll@qt.io>
Done-with: Ulf Hermann <ulf.hermann@qt.io>
Change-Id: I010e6525440a85f3b9a10bb9083f8e4352751b1d
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
After commit c2b4c6393fee37e0c6c4a8c5d40d13120cc8a94e we must also
initialize the set in order to benefit from the improved lookup on the
cache side.
Change-Id: I0f66f118b912ed66a281d16caea67500f9c14046
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Force the use of a global lookup if we know that the
property can and will be found in the global object.
This is possible, as the global object is frozen in QML
mode and can't be overwritten.
Shaves of .5% on the delegates_item_states benchmark, and
will significantly speed up all accesses to e.g. the Math
object.
Change-Id: Ia1e248781a13ebaeb8bc43652e53a6fdde336d0d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We generally have to pass a URL and a file name everywhere because the
logical URL might be something else than the actual file being loaded.
For example a QQmlFileSelector might modify the URL to be loaded for a
specific file. This resulting URL, however, should not be used to
resolve further URLs defined in the file loaded that way.
As we need to access QQmlTypeLoader::m_url as string more often now,
cache it and avoid frequent translations between QUrl and QString.
Furthermore, QQmlDataBlob's URLs are changed to follow the same
semantics. The finalUrl is the one that should be used to resolve
further URLs, the url is the one used to load the content, and subject
to any redirects or interceptions.
This changes the semantics of URL redirects. Previously a redirected URL
was used as the base URL for furher URL resolution. This doesn't work
because redirection occurs after interception and interception should
not influence the resolution of further URLs. We now use the original
URL as base URL for resolution of further URLs and rely on the server to
redirect those, too.
Task-number: QTBUG-61209
Change-Id: I93822f820bed2515995de3cb118099218b510ca4
Reviewed-by: Michael Brasser <michael.brasser@live.com>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is bringing over the loading infrastructure from the Qt Quick
Compiler that allows embedding qml/js files in resources and compiling
them ahead of time.
At the moment, the approach of generating one cpp file per qml/js file
and the loader stub is needed because the build system does not support
dynamic resource generation. In addition, as per QTBUG-60961, we must
ensure that the generated data structures are aligned.
To retain compatibility this is enabled via CONFIG += qtquickcompiler,
but we may need to find a new name (but should keep the old one in any
case).
Task-number: QTBUG-60961
Change-Id: Ia9839bf98d3af4c50636b6e06815364a9fc7ee57
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
The cache files are architecture and ABI independent, so we can remove
any associated field/code as well as the workaround for Android.
Change-Id: Ia52a5be886fc22a2105460e003e7a76af7dc1818
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Since we're now storing bytecode in the cache, the --check-if-supported
option doesn't make sense anymore. Return EXIT_SUCCESS for backwards
compatibility. qmlcache.prf no longer needs the system call either.
Change-Id: Ic3e6de4e404a3d255b57d4bc14e1206c528925a8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|\|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Ahead of time we cannot tell whether the use of "arguments" in a signal
hander refers to the JS arguments object or a potential arguments signal
parameter. Resolving that requires access to information we currently
don't have. The QML engine has it at run-time (in
SignalHandlerConverter) and that's why it works there accordingly.
However when generating caches ahead of time, let's rather produce an
error message with a hint how to work around it instead of producing
differing behavior at run-time.
Task-number: QTBUG-60011
Change-Id: I9e460bd467dbb5998f12a44c439223ea44e7bbad
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This was accidentally enabled because we previously generated the
lookups in the isel (so second part of code generation), where we now
do it in codegen itself (so early on).
Change-Id: I591fbb7a26d94b985c934c5ffca0068b80fac58a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
And changed the namespace of those classes to
QV4::Compiler.
ScanFunctions should over time also move into its
own file.
Change-Id: If084acea4a9a20b9c79ad47dac19e02dc720e098
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Remove all files from the old compiler pipeline that are now
unused. This includes the whole IR, JIT code generation,
and the old Moth Isel.
Change-Id: I50d06abfbcf0e9755a54ed94638f8bb74f9512b1
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|/
|
|
|
|
|
|
| |
Allow registering all the required data to generate the
proper compilationunit already in the codegenerator.
Change-Id: I36345cc01927b3f8dc3ba6d91da175bd6abe124a
Reviewed-by: Erik Verbruggen <erik.verbruggen@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>
|
|
|
|
|
|
|
|
|
| |
The target ABI is something that we must include correctly at cache
generation time. The corresponding qmake variable is available in qtbase
now, so we can use that and embed it in the generated data.
Change-Id: Icd6e44824f5151535ce9ddac27687b7877288725
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
|
|/
|
|
|
|
| |
Task-number: QTBUG-47566
Change-Id: I4a7dc1fe14154695b968fffd14abd2e3189c6ad2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
QQC uses valid constructs like ListElement { dayOfWeek: Locale.Sunday },
where the enums are resolved at type compilation time. Syntactically
Locale.Sunday is a JS expression, but as scripts are not permitted for
list elements, we must retain the values in string form when generating
the binary (cache) qml representation.
This is a forward port of commit
736f4f9c847d1102f6ac77674c831f0555ff445e from the qml compiler, and also
matches QTRD-3226.
Change-Id: I3e615f224d4ab222a50f3271735cb8f7a24f5f11
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The original directory of the source file the cache was created from -
when generating ahead of time - is unlikely going to be identical to the
final location for example on a deployed device. Therefore when
generating caches ahead of time, don't store the source path, don't
attempt to verify it when loading and don't try to save the cache file
at run-time again.
We still need set the sourceFileIndex at load-time though, in order to
make relative path url resolution work (for example source: "my.png" in
an Image element).
Change-Id: I3d6952f5d0a165cfa2cb400191a9f6ffe6be69f4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Cache files created ahead of time do not require a timestamp match
towards the source file. This is because we cannot guarantee that all
transport mechanism from source to deployment preserve the timestamp at
the required resolution (if at all) and the source may also not be
present at all (obfuscated deployment chosen).
For cache files created at run-time however we'll continue to require
time stamp verification.
Change-Id: Ia7cdf3d063edd5bb1e6985089f1a666c970a0bd0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|