| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
| |
QUrl is being added to the bootstrap set.
Change-Id: Ia96bbcf6e0ef808435ecddfa114fdcd213361bbf
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>
|
|
|
|
|
|
|
|
| |
The only thing we actually need is toArrayIndex() and that is a static
method. We provide it in a separate file.
Change-Id: I86b11e3d81a319202a0babacd17d87e7816ac88a
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>
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|\
| |
| |
| | |
Change-Id: Iaaf9749a812c21c065ded0374ce0aa07de7752cf
|
| |\
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
.qmake.conf
src/qmltest/quicktest.cpp
tests/auto/qml/qmlcachegen/qmlcachegen.pro
Change-Id: I70e96e8817d59647f876b8b77b30cdeede8f0662
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This is only useful for the few (4) comparisons where we have
specialized instructions, and it's very error-prone.
Change-Id: I37efe94f54ba0adf393d9236df2d13aa6685eb46
Fixes: QTBUG-74476
Reviewed-by: Simon Hausmann <simon.hausmann@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>
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We only need to check in one central location and we can allow for more
recursion. 4k recursions seem tolerable. A common default for stack
sizes is 8MB. Each recursion step takes up to 1k stack space in debug
mode. So, exhausting this would burn about half of the available stack
size. We don't report the exact source location in this case as finding
the source location may itself trigger a deep recursion.
Fixes: QTBUG-74087
Change-Id: I43e6e20b322f6035c7136a6f381230ec285c30ae
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Result objects are rather large, 96 bytes here. In a recursive algorithm
such as our parser, we should not keep too many of them on the stack.
Also, the size of Reference can be reduced by employing a bit field
rather than a number of booleans.
Also, try to convince the compiler to inline the accept() functions. The
extra stack frames those create are unnecessary.
Task-number: QTBUG-74087
Change-Id: I5c064491172366bb0abef99ffe9314080401a7d1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | |
| | |
| | |
| | |
| | | |
Change-Id: I0bb5055024e30c32b82e1555c820ea5ced8923f5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|\| |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
src/qml/compiler/qv4codegen.cpp
Change-Id: I604517d0948fb5056ce36cc104f13ac956fbcc24
|
| |\|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
src/qml/compiler/qv4codegen.cpp
src/qml/animations/qsequentialanimationgroupjob.cpp
Change-Id: I8b76e509fd7c8599d4cef25181d790ee28edab54
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This prevents jumping over the resetting of the unwind handler when an
exception occurs.
(cherry-picked from commit 0282b89ec672e25a465a8e51bc74c7fd58a624b1)
Fixes: QTBUG-73985
Change-Id: I4a4da815f54c13980d239e0492f9b013991cfbd5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
If there was a rest element in the list, the generated code would jump
over the clean-up (closing of the iterator). However, this would also
jump over any resetting of the unwind handler.
(cherry-picked from commit 3310f173c1c6208cb0f6541578419196bc29831f)
Task-number: QTBUG-73985
Change-Id: I9a1bcb9e69fd98975fe9c89e23a4568b0dafdf83
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Previously the generated code looked like this:
Jump loop-body
loop-condition:
acc = condition
JumpFalse loop-end
loop-body:
...
Jump loop-condition
loop end:
...
This is a problem for anything that analyzes the bytecode in 1 pass from
top to bottom: at the point of the loop-condition the state of the
interpreter isn't known yet: that state will only be known after
analyzing the loop body. The new generated code does not have that
problem:
loop-body:
...
acc = condition
JumpTrue loop-body
loop-end:
...
Change-Id: I16977e9ce1f9377e7bf4d09afc16136ba0111463
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
|\| |
| | |
| | |
| | | |
Change-Id: I51cb42d253a83c0e6a76946c37cf1ff7c7cac150
|
| |\|
| | |
| | |
| | | |
Change-Id: I2842f4a8096c4555e29f08e65b88b77b841441cb
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
If fast QML lookups are disabled, we generally want to look up by
string. If the name then happens to be a member of the global JavaScript
object, we still don't want to directly access that, as the name could
have been overridden in a deeper context.
Fixes: QTBUG-73750
Change-Id: Id16110969123d91501064ba46bfad4c2a39e4650
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This patch also rotates the loop back so that the condition is at the
top of the loop.
Change-Id: I410792c0bdaf87af6fec86a256ea39947721daec
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
If there was a rest element in the list, the generated code would jump
over the clean-up (closing of the iterator). However, this would also
jump over any resetting of the unwind handler.
Change-Id: I68b8a4ca16e72d523ab5af98bb5ca2ec01297b23
Reviewed-by: Lars Knoll <lars.knoll@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>
|
|\|
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/qml/compiler/qv4codegen.cpp
Done-With: Erik Verbruggen <erik.verbruggen@qt.io>
Change-Id: I3ae3d64317e4f3fccba6605f4c6da15479ca75e0
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Consider this JavaScript snippet:
function f() {
for (var i in []) {}
}
This generates the following bytecode sequence:
2 0: 14 00 09 MoveConst r3, C0
3: ec 00 00 DefineArray (function), 0
6: da 00 GetIterator 0
8: 18 08 StoreReg r2
10: c0 0f SetUnwindHandler 27
12: 50 04 Jump 18
14: 16 0a LoadReg r4
16: 18 07 StoreReg r1
3 18: 16 08 LoadReg r2
20: dc 0a 09 IteratorNext r4, r3
23: 54 f5 JumpFalse 14
25: 50 03 Jump 30
27: c0 00 SetUnwindHandler <null>
29: c2 UnwindDispatch
4 30: 0e LoadUndefined
31: 02 Ret
The problem is a normal loop exit: instruction 23 will not jump back,
but fall through, and then instruction 25 will jump over the
instructions resetting the unwind handler (27 + 29). Removing this jump
fixes the issue.
Change-Id: Ic9f03555ebebc27144490bce04e9a4166ed7c97c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Make sure the unwind handler is always reset when leaving the
try block.
This exposes a couple of failures in the ECMAScript test suite
that were before passing by pure luck.
Task-number: QTBUG-72858
Change-Id: I014b1e37c2beff136ecd53a665a2f10933f7e12c
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Reviewed-by: Erik Verbruggen <erik.verbruggen@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>
|
|\|
| |
| |
| |
| |
| |
| | |
Conflicts:
tests/auto/qml/debugger/qqmldebugjs/tst_qqmldebugjs.cpp
Change-Id: Ic1dace832ad4b29023d24808b8617b5dcc915eb5
|
| |\
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Conflicts:
src/qml/jsruntime/qv4script.cpp
src/qml/parser/qqmljslexer.cpp
Change-Id: I82252a8c504a4b77c45f4f8efe849ff9acb949fd
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Since change 9333ea8649838d7e0400b0e94c8cbd4fa5d216b0, we lookup
properties in the QML context object before the global object to
have proper scoping rules for QML.
Unfortunately this lead to a performance regression when using global
properties such as Math in imported script files, as the lookup would
always go through the qml context first.
This can be fixed, as we know that the global object is frozen in qml
mode, and the standard names of properties in the global object are
illegal to use in QML. So simply check for those names in the code
generator and create lookups into the global object for those.
Change-Id: I4b2089178c9e5f9440abdfd834cf7d92c3c0e2c3
Fixes: QTBUG-71591
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fixes -Wclazy-unused-non-trivial warnings, in preparation for using
gcc/clang's warn_unused attribute in all containers.
Maintainers please check if some unused variable isn't hidding an
actual bug.
Change-Id: I83c5a11aa2328db3dce4c6c402295d86ef297c83
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is to prevent extremely deeply nested expressions and statements
make the code-generator run out of (native) stack space.
Task-number: QTBUG-71087
Change-Id: I8e1a20a361bff3e49101e535754546475a63ca18
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: If9468b93b08ad355f07d1436ca88e8d36be22070
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The destructor for the Jump object will check if it is linked somewhere.
So when doing an early-exit after generating a jump (and before linking
it) and after an error occurred, make sure to call link anyway. At this
point no code will be generated, so where the jump points to is kinda
pointless.
Change-Id: I09fa03d4224805a838088acd0c5c83d02b328045
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|\|
| |
| |
| | |
Change-Id: I7623438dde316ae1e97802f91991f2e7ccc205a5
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We won't use the bytecode anyway, and it prevents consistency checks
that come after the error from failing. Specifically: there might be
jumps that have no label defined.
Fixes: QTBUG-71738
Change-Id: I62a7e943b0156d42caccfa40507853de79e3b1ce
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>
|
|/
|
|
|
|
|
|
|
| |
Create the proper template object for a tagged template.
This fixes quite a few use cases (esp. String.raw), but is not
yet 100% spec compliant.
Change-Id: I69eaee22c384c0d1bd2c6c56ad711d29521b0b86
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>
|
|
|
|
|
| |
Change-Id: I34d70759732433b6f0ecccc5ae175d33ec8e1577
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
For example: 'for (foo() in something) {}' is not valid: a call
expression is not an lvalue.
Task-number: QTBUG-71086
Change-Id: Ia1498cd38526b073afb8e4524ceaea14dca3d65f
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
| |
There is a {{Q_UNREACHABLE}} right after it.
Change-Id: Id69fb1403a5f99912e6fbcb4a397a78a9d6948d7
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
The visit() methods need to return false on parse errors, so
that we don't continue iterating into that subtree of the AST,
but rather exit as quickly as possible.
Task-number: QTBUG-71090
Change-Id: I1912d955a0ffc86389a4cbbb3b6ac0209c3c556a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|