| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
| |
| |
| |
| |
| |
| |
| | |
Array destructuring assignments require a call to iterator.return if
the iterator hasn't been exhausted during destructuring.
Change-Id: I39fe4bc01bef6fb2ad3bda92caf6779fbbddc8e2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The instruction now writes the value into a stack slot,
and returns the done state in the accumulator. This should
make it easier to implement the IteratorClose functionality
required by the spec.
Change-Id: I8cc497c54b0d044bd3c68a5a1b774eea8b2740ef
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
"var [x, ...y] = array" now works as intended.
Change-Id: I45238f27f468d0b0e14dc0e931c55c4f40043690
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Array destructuring should use iterator objects, not integer
indexes.
Change-Id: I769bb1d63246da6bc45233f7a6e9a8e5ddc53a4d
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Added an IteratorNext instruction to fetch the next
iteration value (empty if the iterator is done).
This will also help to implement array destructuring without
requiring huge amounts of byte code.
Change-Id: If96c1e81471e5e2b0b7b2af122238d87741aa371
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Regular for loops also have a per iteration context for lexically
declared variables as well.
Change-Id: I35cb58bfb198c7dc32d70f41ea0ced7ddefcc37e
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This requires a bit more work than simply pushing a
new BlockContext for the lexically declared variables,
as eval() and the Function constructor operate on the
global scope (including the lexically declared names).
To fix this introduce Push/PopScriptContext instructions,
that create a BlockContext for the lexically declared
vars and pushes that one as a global script context that
eval and friends use.
Change-Id: I0fd0b0f682f82e250545e874fe93978449fe5e46
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The support is basically at the same level as for for-in
at the moment.
Currently unimplemented:
* Destructuring
* Proper lexical scoping
* calling iterator.throw()/return() when required
Change-Id: If193ce0b054c4315fc16b7e174334a31b2730dcf
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add support for ES6 generators. Those are currently
always executed in the interpreter (we never JIT them),
to simplify the initial implementation.
Most functionality, except for 'yield *' expressions
are supported. 'yield *' will have to wait until we
support for(... of ...)
Change-Id: I7c059d1e3b301cbcb79e3746b4bec346738fd426
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Remove the need for a specialized catch context, instead
use a regular block context, that also captures the
catched variable.
This also removes the need to do lookups by name inside
a catch expression.
Change-Id: I8b037add7f423922e2a76b4c0da646ca7e25813a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This is still to some extend work in progress as
lexically scoped for loops won't yet do the right
thing.
let and const variables are still accessible before
they are declared, and the global scope doesn't yet
have a proper context for lexically declared variables.
Change-Id: Ie39f74a8fccdaead437fbf07f9fc228a444c26ed
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I58a21e70fdd040175b52465d6ba52e7fceaf6398
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I4b18a88e443f3b263cbb1e2b5ca1ebbd353afa98
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
function foo(a, b, ...c) {...} now works correctly.
Change-Id: Ie442a0e7cc5e9dc4156e56b348bba305cced8531
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|/
|
|
|
|
|
|
|
| |
The parser can also handle rest parameters correctly, this will
however require some additional work in the runtime to support
it correctly.
Change-Id: Ib6f4d27683774966b2d2aac075494d2f5066d2a2
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Given the following expression
var x = MySingleton.MyEnumValue
where MySingleton is a QML (composite) singleton and MyEnumValue comes
from a QML declared enum, we had code in place up to (and including)
5.10 to attempt to optimize that expression to a enum constant at
compile time. In 5.10 that optimization does not exist anymore. In <=
5.10 we would also skip the optimization under certain circumstances
(too many statementes, etc.). The fallback that is in place for handling
this at run-time tried to be smart by avoiding the
QQmlContextWrapper::get lookup and return straight a reference to the
singleton as QObject. That works for regular property lookups, but it
fails when trying to look up something like an enum, that isn't a
meta-object property.
Change-Id: I1819b9d8ae06a3f595e067bf5b018c4065be76bb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
When a function is called that is in a QML scope or a QML context, set
the 'this' object to the QML scope. This is done by introducing two new
interpreter instructions, which get the context passed in.
Note: this patch is 5.11 specific. 5.9 had a similair issue, but the
implementation is quite different, so that was fixed separately.
Task-number: QTBUG-66432
Change-Id: Ie43150cdd26360025895df28d31264985abf1c15
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: Ie1b18dd00705b1913572b87c6968a63438e7a90c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
| |
We cannot build QML without interpreter anymore.
Change-Id: Ibc51240caa956132eef8753fa6c75939026930d5
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
| |
Ensure that the integer arguments for widely encoded instructions are
always encoded as little endian.
Change-Id: Iccd45aefb20b20d76fe1618d6706435142b202b9
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Due to the difference of sign of the char type, byte code is encoded
differently on x86-64 than if it was on ARM and it also is decoded
differently. The problem at hand here was that negative jumps were
encoded as two-byte instructions (opcode and negative offset as byte) on
x86-64 when qmlcachegen is run. At run-time the negative offset was read
into a char type and consequently interpreted as a positive jump,
leading to crashes.
The explicit use of qint8 as signed byte type in encoding/decoding
sensitive parts avoids the decoding issue and should also result in
consistent encoding.
The added auto-test is (among other configurations) run in the CI under
qemu, which means the x86-64 host-built qmlcachegen will generate byte
code and the tst_qmlcachegen ARM binary will run under qemu and
reproduce this scenario.
Task-number: QTBUG-65521
Change-Id: I615628f53475dad38a41095c6e7ffea0c34d58ac
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
Otherwise we get:
Internal error: assertion failed at: "shared/cfe/edgcpfe/il.c", line 9371
Task-number: QTBUG-64981
Change-Id: I9a4bd81eb9d1ffee23c22f818583c06f9e74433b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
We used to store the value-to-be-called in the accumulator. So the
generated bytecode looked like:
LoadReg r1
CallValue()
The first thing done in CallValue is to store the accumulator. So by not
loading the accumulator, we can actually remove the subsequent store,
which results in less interpreter instructions and one less store in
CallValue.
Change-Id: Icc7c8a5449bf369b9226d66bc6055cb705ef660e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
| |
LoadRegExp is nearly always followed by a store of the accumulator, so
change LoadRegExp to be MoveRegExp. This saves an instruction.
Change-Id: I5d47c5bf6ffd7f28247c328410872c3b229ca23c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|\
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Conflicts:
src/qml/compiler/qv4isel_moth.cpp
src/qml/compiler/qv4jsir_p.h
src/qml/jsruntime/qv4engine_p.h
src/qml/jsruntime/qv4vme_moth.cpp
tests/auto/qml/qml.pro
Change-Id: Ia7b6ec24c7fcbcbb1786d9e798d2df294020ae37
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Give them a pointer to argc and argv instead of a pointer
to a full callData. Like this we can construct the callData
at the end of the JS stack and avoid the need to create an
additional copy in VME::exec().
This also opens up the option of completely avoiding all copies for
calls into runtime methods.
Also make sure that the calldata we pass into other functions is
always at the top of the JS stack.
Change-Id: I3d0eb49f7bfd7adb9ddabb213422087c66e5a520
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: Ibefac50246045066c90c4c2dbc36d2776c5dab0e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Also disable -Wmaybe-uninitialized after disabling -Wuninitialized,
because the logic for this warning differs per GCC version.
Change-Id: I52e26cfd735e437d3ad59c2be22df6c67a1245b1
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
... by actually doing a dispatch.
Change-Id: I80ccbda6f52fcc9da27977f7c0a5bc526926181b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
The complaint from GCC was that a static array InstrInfo::argumentCount)
cannot be in a union.
Change-Id: Ibd8dad478dc95853004fb2a871d5883d4dc73dcc
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- safely truncate a size_t to an int
- __VA_ARGS__ expansion is slightly different on msvc, so massage some
usages
- use unused labels
Change-Id: I0a90bd15f9ddf7e0faea1ae8bb0e51cb9574a205
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
We now have separate instructions for comparissons, which put the result
in the accumulator. Then a JumpTrue/JumpFalse is generated to do the
actual jump.
Change-Id: I50a9d5899a6e071f4997931de6e8eb62596723cd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This will allow us to further cut down on function call
overhead. To make this work, introduce a proper distinction
between EvalCode and GlobalCode and use the correct
compilation mode in all places.
Change-Id: I070621142159b7416026347c9239200c5ed7a56b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I4494dae8166026074c9efc74bac62de9d3fa2342
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I1ddc179fb19983d079872bd59a48e83de7af8494
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
sizeof(Ret) is 1, but the Size was rounded up to 4.
Change-Id: I5022e369937458ccaa3efed066f62d2c2d36c3a0
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The old map assumed that line numbers are always increasing, something
that isn't always true. So move to a format where we map blocks of
bytecode to a line number instead.
Change-Id: I1cd9dd1329d415122cd3d560294ef53007f879f8
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: Ia70727deb008021cbef6e546816b33ff0ce64afa
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I8b93270b5aebd39df8f88166e183814f6391c0f5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I084979a6fef7cce9a825cae9ce57234583ceb3ce
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Only keep 1 byte and 4 byte wide instructions. As this gives
less than 256 distinct instructions, those can now again be
encoded in 1 byte, dropping the Wide and XWide prefix instructions.
This gives us 95% of the size savings that we had before, by
being able to encode the full instruction in one byte, while
bringing back pretty much all of the speed lost through the
compression.
Change-Id: I9ec978d43314ed304ca0ee5546035d2b581b6dc3
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Fix the code for compilers not supporting computed goto and
unify the code paths with the ones supporting it as much
as possible.
Change-Id: I32ca8402ee11893e158d055bb962bac829dd2a91
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Clang does apparently manage to create somewhat better code
with these changes.
Change-Id: Ifbb9893b3b511c90abaf778ca3b8e795e21cc8b7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I90daee5388f5aba5a5c1cd643379adc9a8e05039
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
And add proper decoding for the prefixed instructions to the
VME and bytecode dumper.
We still only generate XWide instructions, that will get fixed
in the next change.
Change-Id: I6d2dc6a0a4f706044038274ca79e019a6c9bb7d9
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
As a first step, use only one byte for the instruction type.
Change-Id: I762a05233c277a7144472793bc71e41d9e8e82cb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| | |
Change-Id: I9aec7ab939082c902a32d4cfd00b5e00ad3683bc
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
And add Wide and XWide instructions that will get used
as prefixes later on.
Change-Id: I993865395ee2ac7d30eba2e41e7b437bfdb54391
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| |
| | |
Don't use the old instruction structures in the VME anymore,
instead directly decode into scoped registers.
Change-Id: Ie03ebad98050ebfd9eb9cc7e9273e5db92884a89
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| |
| |
| |
| |
| |
| |
| | |
This will simplify moving over to a compressed bytecode format.
Change-Id: Iba88723fe69149d798552582025867b19c881d00
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|