| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
| |
Due to qiterable.h specializing a template declared in qmetatype.h we
temporarily need to include it in a few tests so that the iterables
work.
Change-Id: Ia32392419dead76eaf2b91b2ec4157b726d8de74
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
| |
This is required to remove the ; from the macro with Qt 6.
Task-number: QTBUG-82978
Change-Id: Iead53d18fd790fb2d870d80ef2db79666f0d2392
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
| |
Change-Id: I439bcd0219b53ab0fa9450523ee0efcc75db68e7
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit d4edf441257b7e5782a6c25802d821647ffcba45 fixed the issue for
architectures where the return value register overlaps with the
accumulator register and thus clobbers it (x86-64, x86). The issue
however persisted on ARMv7 (and in theory also ARMv8). Further
investigation suggests that another source of clobbering of the
accumulator register may be the caller of the JIT generated code itself,
since we never explicitly initialize the register. So if one of the
first byte code instructions is the creation of a call context or
ConvertThisToObject - anything that saves the register to the JS stack
frame - then we could end up with the GC trying to mark a value that
contains garbage (or looks like a managed, typically).
Change-Id: I719e189c3314c85adb23fb2ab2a0acf26a418d4e
Task-number: QTBUG-83384
Pick-to: 5.15
Pick-to: 5.12
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Commit db3dd029d7cd911712102efd5ea71868494f9f6f introduced the saving of
the accumulator register on the JS stack in more situations. This
unveiled another bug: When the physical ACC register contains garbage,
we may end up saving it on the stack and thus making it visible to the
GC. That one may trip with the infamous Q_ASSERT(m->inUse()) assertion
failing when the value looks like a managed pointer but in fact isn't.
So the question is: How can garbage end up in the physical ACC register?
Thanks to a detailed bug report from David Faure, KDE's ktexteditor
kateindenttest (testCstyle:comma6 in particular) triggered this
situation when run with aggressive GC, where the prologue of a generated
constructor function started with two instructions
CreateCallContext
ConvertThisToObject
The first instruction is a call into the run-time with
CallResultDestination::Ignore - it's a "void" call. The second
instruction starts with STORE_ACC and also ends up allocating memory,
triggering the GC when run with aggressive mode enabled.
The problem here is the ::Ignore option for the return value. It means
that the ReturnValueRegister is clobbered and may contain anything. If
the ReturnValueRegister is the same as the AccumulatorRegister, then
the STORE_ACC call later will end up writing "garbage" into the JS
stack.
As a remedy, this patch treats the ::Ignore case special and loads
undefined into the ACC when the return value register and the ACC
register are the same.
Change-Id: I82c7a3456125f9c87e83abb9eb54465106873560
Task-number: QTBUG-83384
Pick-to: 5.15
Pick-to: 5.12
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
|
|
|
|
|
|
|
|
|
| |
It is actually called from only one place, so adapt it to what that
caller really needs, removing more excessive newlines.
Change-Id: Ieb1a24ddb911d86af1f862e35e4fdd7ad2d9ff13
Reviewed-by: Fabian Kosmale <fabian.kosmale@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
The method names are only used for debugging purposes. We don't need to
pass them through production code. Centralize the names of all the
runtime methods in a symbol table and only look them up when actually
printing them.
Change-Id: I0d9d7db04b961841242acdbaaa7a2ba29b1f4ff2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|\
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/qml/jit/qv4baselinejit.cpp
src/qml/jsruntime/qv4vme_moth.cpp
tests/auto/qml/qqmlecmascript/tst_qqmlecmascript.cpp
Change-Id: Iec7cd27ddad0281bd3b7833fb6b252f66a6ae5d6
|
| |\
| | |
| | |
| | | |
Change-Id: I6472cd72b27c69257efe54376e428274ebf68050
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We need to keep the accumulator alive across function calls. This
requires:
1, Saving the accumulator on the stack if the function might allocate, to
protect it from the garbage collector. However, we don't need to do
that if the result of the function is to be saved in the accumulator
and the function itself doesn't use the accumulator as argument. In
this case the previous value becomes unaccessible and we might as
well GC it.
2, In the JIT, restoring the accumulator from the stack after the
function call if we want to ignore the return value.
3, Therefore, also saving the accumulator on the stack before calling in
case of 2.
We assume that we don't need to keep the accumulator alive across the
jump to the exception handler. Saving the accumulator more often than
necessary is detrimental for performance. To make sure the assumption
holds, explicitly load the accumulator with undefined _before_ jumping
to any exception handler.
Change-Id: I78cbc42847b8885a0659b23f3b81655b7f1a0bc4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|\| |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
tests/auto/qml/qjsengine/tst_qjsengine.cpp
Change-Id: I34df194046a91ee8a076ce28022eb99d68e7f362
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
src/qml/jsruntime/qv4memberdata.cpp
Change-Id: I4e9ffc89d65279a42516f5547e93fb47fb571834
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We don't use the accumulator in that method. It could contain any random
value.
Fixes: QTBUG-75642
Change-Id: I41f958c1174cce76d0d77e14d5617d441aaf1e11
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The static part can be used for compilation and won't resolve managed
objects. This allows us to remove all the remaining V4_BOOTSTRAP.
Change-Id: Id2f6feb64c48beb2a407697881aea8c0d791a532
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We don't build the assembler or the JIT in bootstrap mode.
Change-Id: Idc3a56cc1e9cfba415bef9cba221c8a60ee75010
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Add an atomic isInterrupted flag to BaseEngine and check that in
addition to the hasException flag on checkException(). Add some more
exception checks to cover all possible infinite loops. Also, remove the
writeBarrierActive member from QV4::EngineBase. It isn't used.
Fixes: QTBUG-49080
Change-Id: I86b3114e3e61aff3e5eb9b020749a908ed801c2b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The tracing JIT won't be finished. Therefore, remove the parts that have
already been integrated.
Change-Id: If72036be904bd7fc17ba9bcba0a317f8ed6cb30d
Reviewed-by: Erik Verbruggen <erik.verbruggen@me.com>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This way you can enable or disable the JIT when configuring Qt. The
conditions for the availability of the JIT have also been cleaned up.
There is no reason anymore to artificially restrict availability on x86
and x86_64. The reason for the existence of those clauses are old
problems on windows that have been fixed by now. However, on arm and
arm64, we need a specialization of the cacheFlush() function for each OS
to be supported. Therefore, restrict to the systems for which such a
specialization exists. iOS and tvOS are technically supported and you
can enable the JIT via the feature flag now. Due to Apple's policy we
disable it by default, though.
Change-Id: I5fe2a2bf6799b2d11b7ae7c7a85962bcbf44f919
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It's deprecated
Change-Id: Id901056e3a4ca378fb03486cd941e7e7222ffbc4
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is a scheduler for the graph nodes, which first reconstructs the
control-flow graph, and then places all remaining nodes inside the basic
blocks.
The output of this pass is an MIFunction (MI = Machine Interface),
which uses a representation suitable for feeding to an assembler. Note
however that it still uses "virtual registers" at this point, so the
next pass will have to place those virtual registers in physical
registers or on a stack.
The code for the dominator tree calculation, block scheduling, loop info
and the blockset were lifted from the 5.10 JIT.
Change-Id: I11c4cc3f64fedba6dd4275b35bbea85d30d76f7d
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This pass converts high-level operations like e.g. a JSAdd to lower
level operations, like a runtime call. This pass will be extended to
take trace information, which can indicate that it can be lowered to
e.g. an AddInt32.
Change-Id: Ieae8df235217189c90048515e199f7e7c7f220b3
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|\| |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
src/qml/compiler/qv4compileddata_p.h
src/qml/jit/qv4baselinejit.cpp
src/qml/jit/qv4jithelpers.cpp
src/qml/jsruntime/qv4lookup.cpp
src/qml/jsruntime/qv4runtime.cpp
src/qml/jsruntime/qv4runtimeapi_p.h
src/qml/jsruntime/qv4vme_moth.cpp
src/qml/qml/qqmltypemodule_p.h
Change-Id: If28793e9e08418457a11fc2c5832f03cab2fcc76
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When resolving names in the context of QML bindings, we now direct
runtime access to QQmlContextWrapper::resolveQmlPropertyLookupGetter. At the
moment this does basically the same as Runtime::method_loadName, which
we called earlier. However this now provides the opportunity to optimize
lookups in the QML context in a central place.
When performing a call on a scope or context object property, we also
did not use a CallName() instruction - which would have gotten the
thisObject wrong - but instead we use a dedicated
CallScopeObjectProperty and CallContextObjectProperty instruction. These
rely on identifying these properties at compile time, which goes away
with lookups (and also doesn't work when using ahead-of-time
compilation). Therefore the qml context property lookup is using a
getPropertyAndBase style signature and
Runtime::method_callQmlContextPropertyLookup uses that.
For the tests to pass, some error expectations need adjusting. In
particular the compile-time detection of write attempts to id objects is
now delayed to the run-time.
The old code path is still there and will be removed separately in the
next commit (as it is massive).
Task-number: QTBUG-69898
Change-Id: Iad1ff93d3758c4db984a7c2d003beee21ed2275c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
toInt32LhsAcc convertes both the lhs and the accumulator to int32. If
the accumulator is not saved, a GC run during the conversion of the lhs
might trash its value.
Fixes: QTBUG-74058
Change-Id: Ic42693061c7d483bb430d77bcc095de6ff9a6843
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: I0bb5055024e30c32b82e1555c820ea5ced8923f5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is the in a series of patches for a JIT that can use traced
information to generate better code. In this patch, traced information
is not used/stored yet. It allows testing the basic infrastructure
without trying to do any optimizations, therefore making it easier to
debug, test, and review.
Change-Id: I589bdadf731c36542331abe64e1b39e305b6723e
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|\| |
| | |
| | |
| | | |
Change-Id: I51cb42d253a83c0e6a76946c37cf1ff7c7cac150
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
src/qml/qml/qqmlpropertycache.cpp
Change-Id: Ie7727499700b85cc0959ef3abb30d55dc728b659
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
For platforms where arguments are passed on the stack, we would do an
invalid (off-by-one) calcultion to see where we should put arguments for
a tail call, thereby overwriting other values. As we don't write to
these memory locations anywhere, and the arguments are exactly the same
as calls to jitted code (which is done by design), we could just as well
re-use them.
Change-Id: If4118b2023da6dc301252a1579a36df0e0cbc3a5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The declarations and usage of runtime functions have seen a number of
changes:
- we don't use the array of method pointers anymore because we don't use
cross-platform AOT JITting
- the check if a method can throw a JS exception was invalid, and was
not used anymore
- value-pointer vs. const-value-ref was inconsistent
This patch cleans that up. By fixing the exception checking, we can now
use it in the baseline JIT to automatically insert those checks. To make
that work correctly, all runtime methods are in a struct, which gets
annotated to indicate if that method throws. (The old way of checking
which type of engine was used is fragile: some non-throwing methods
do not take an engine parameter at all, and those got flagged as
throwing). By using a struct, we can also get rid of a bunch of
interesting macros.
The flags in the struct (as mentioned above) can later be extended to
capture more information, e.g. if a method will change the context.
Change-Id: I1e0b9ba62a0bf538eb728b4378e2678136e29a64
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
If ProcessInstruction is returned, the generate_* function and
endInstruction will be called. If SkipInstruction is returned, they
won't be called. This can be used by subclasses that can detect dead
code, to suppress handling that code.
Change-Id: I3b4a8eebb5701f287c8199bd40bc63fe04a35007
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
Now other subclasses of the BytecodeHandler can also use the method.
Change-Id: Ib1a19e5ef6beb6c62b6a0214a6658f57b7e74a1a
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When analyzing the bytecode from top-to-bottom in a single pass, we
don't know when a jump back to previously seen code occurs. For example,
in the baseline JIT we would already have generated code for some
bytecode when we see a jump back (like at the end of a loop body), and
we can't go back and insert a label to jump to.
As JavaScript has no goto's, the only backward jumps are at the end of
loops, so there are very few cases where we need to actually generate
labels.
This was previously handled by analyzing the bytecode twice: once to
collect all jump targets, and then second pass over the bytecode to do
the actual JITting (which would use the jump targets to insert labels).
We can now do that with one single pass. So the trade-off is to store
4 bytes more per function plus 4 bytes for each loop, instead of having
to analyze all functions only to find where all jumps are each time that
function is JITted.
Change-Id: I3abfcb69f65851a397dbd4a9762ea5e9e57495f6
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Collect type information about values used in a function. These include
all parameters, and the results of many bytecode instructions. For array
loads/stores, it also tracks if the access is in-bounds of a
SimpleArrayData.
Collection is only enabled when the qml-tracing feature is turned on
while configuring.
In subsequent patches this is used to generated optimized JITted code.
Change-Id: I63985c334c3fdc55fca7fb4addfe3e535989aac5
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
This includes removal of the QV4_SHOW_ASM environment variable.
Change-Id: Ibbaf7f6eabd1b66e8539bcbcc3febdd79742e003
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|\|
| |
| |
| |
| |
| |
| | |
Conflicts:
.qmake.conf
Change-Id: I6b2539bf17d3e9bc66d96b53c1bce95680113ed8
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Helper calls done for to-integer and to-number conversions did not align
the stack on 16byte boundaries, which could lead to crashes if somewhere
in that call a vector instruction is used that expects such alignment.
Task-number: QTBUG-71325
Change-Id: Ieec05a93a1f69b538e6c8930b8eb64cbe85c35d4
Reviewed-by: Jüri Valdmann <juri.valdmann@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
| |
In order for global exception handlers to be called reliably, the runtime
needs to unwind through JIT-generated code. This can be facilitated by
installing a "function table" for each JITed function that specifies "use
the frame pointer".
Also make sure to generate a function table for JIT'ed regular
expressions. Those were forgotten also in the linux case.
Fixes: QTBUG-50061
Change-Id: Ib0b8ae9356ed80afe1cab017e36efa4ccbe73f90
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|\
| |
| |
| | |
Change-Id: I7623438dde316ae1e97802f91991f2e7ccc205a5
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
As with the 64bit implementation: use the scratch register. The return
value register is used to hold the newly allocated space on the JS
stack.
Fixes: QTBUG-71319
Change-Id: Ia924ad24ff7f4fbf5ec21b6e6237cce7d907bf3e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|/
|
|
|
|
|
|
| |
If a tagged template gets evaluated multiple times, the
underlying template object is shared.
Change-Id: Ie2f476fbc93d5991322ce1087c42719a8d8333ae
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When the accumulator doesn't overlap the return value registers, we move
the accumulator value there when doing a function exit. This happens for
arm32 and arm64. This is a problem when doing a tail call: these
registers are also used to store the first two arguments for the call,
so restorating will wipe them.
Task-number: QTBUG-71212
Change-Id: Ifd82729e8741418c1b54e804724893e02bd180c7
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
This reverts commit 41e15cb21c2f8924eee56aacc4ba8aace950cae5. The
patch causes us to hit assertions in the x86/x64 JIT. Somehow
this slipped through CI.
Change-Id: Ia77ecb956472172bf5543c01fdccd6dddedba168
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
| |
Change-Id: I7327f982d11a0d2942750ebfbc9f0d379093b87e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
| |
So searching for "function blah" will find both the dumped bytecode and
the generated assembler from the baseline JIT.
Change-Id: Ia1e2debfb73068a1692653f304146f7b0f88aa16
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
| |
This runtime function was the only one taking argc before arguments.
Change-Id: If0b049697f7fcc2746e8d287193a5b1230a6ea56
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
| |
Change-Id: If1629109722496b3fd10b36b2376548440f2fee9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
| |
Doing the tail call in the runtime will come in a follow-up patch
Change-Id: I8224aac0edbdc765ee9b97703948edd52fd33f3e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|