| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With the QV4::Moth::BytecodeGenerator::Jump type we are relying on the
compiler doing a return value optimization. That however is not required
by the C++11 standard and the GHS compiler does indeed not do that here,
resulting in a ~Jump destructor call in the following sequence _before_
link() is called:
Jump generateJump() { ...; return Jump(...); }
...
generateJump().link();
The destructor however verifies that link() was called, which fails.
Fix this by making Jump a move-only type, which the compiler will issue
if it doesn't perform a return value optimization.
Task-number: QTBUG-66917
Change-Id: I97cc9a5d7f97d61e573ad8bc309cf48ab18eb25d
Reviewed-by: Kimmo Ollila <kimmo.ollila@qt.io>
Reviewed-by: Erik Verbruggen <erik.verbruggen@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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Debug instructions are used to trigger break points and are added for
every source line.
We also need to insert Debug instructions before Ret, so that we can
step out. We also need to assign line numbers to the entry and return
points of "abbreviated" QML functions (by simulating lbrace and
rbrace) so that we can set break points on them. The line numbers on Ret
need to be negative, so that you cannot (accidentally) set break points
on them. A typical signal handler or binding in QML consists of only one
line and if you set a break point on that line, you want it to hit only
once, when entering the function. If the line numbers on Ret were
positive, it would be hit again on exit. Some of the tests in
tst_qqmldebugjs implicitly check for that.
Also the new interpreter does something on the left brace, so a
function actually starts there, not on the first statement.
Change-Id: Id9dfb20e35696b420d0950deab988f7cc5197bfc
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>
|
|
|
|
|
| |
Change-Id: If95a5733594a1beaa41063249a364988190844c5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: I90daee5388f5aba5a5c1cd643379adc9a8e05039
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>
|
|
|
|
|
|
|
| |
Instead add it to the unencoded instruction vector
Change-Id: I7e88d808bb94f75aecdf9d3ed9bace2055c1da5d
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>
|
|
|
|
|
|
|
|
| |
Simplify the naming conventions, so that both the instruction
struct and enum start with upper case letters.
Change-Id: I60c5a95d729e0b68b5a40f7db0e8f90be5938032
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
|
|
|
|
| |
Don't emit any Line instructions anymore, and instead store
the info in a side table in the compiled data, where it can
be looked up on demand.
Change-Id: Idcaf3bf4ee4129fd62f9e717bf1277dc6a34fe19
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
don't use the return value register for normal functions
anymore. It's still needed for eval code and qml bindings
that have an implicit return value, as the accumulator gets
clobbered too easily in those cases.
Also get rid of the exit block we used to generate.
Adjust the control flow handlers to correctly unwind. This
required adding some jump instructions that left the
accumulator untouched (as it now holds the return value)
and using those in handlers.
Change-Id: I2ca1afaf7234cb632e5d26ba5b10ec3f11f50c93
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
|
|
|
|
|
| |
All escaping arguments will still be loaded/stored from/to the CallData,
but this is not the common case. In a subsequent patch we can make the
caller prepare the stack frame, and for the common case we don't even
need to copy arguments around.
Change-Id: I3fbb6fe575a564d05a9fd5dcc0c8f4129eac3bc2
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
| |
Change-Id: Ib7839ac09f520aaff3fadfdb37ea63d85a257bfd
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
| |
As a preparation to also store arguments on the stack, just like the
temporaries.
Change-Id: If3a6ed56930e29ad77c992811065bb32ee2d030c
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
| |
Change-Id: I00d4ed5d8b6ab30ee3459d1cc7a2737144474f8a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
| |
This reduces the number of stores to the stack (for which we need a
write-barrier in the future) by keeping the last calculated value in the
accumulator register (which is a local variable).
In the future we might want to collapse certain common instruction
patterns into a super-sized instruction.
Change-Id: I02ebed2db957765e994c8f939bf7585894881deb
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
| |
Change-Id: I9f4a5a8470c1abc6b07a28c71fdad0d208e1fea1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
|
| |
The Param struct is now internal to the interpreter loop. It can be
removed in a second step so we can directly access
constants/temporaries/locals/arguments.
Change-Id: I47ecbfe7508f352a8f212af48461dc92b35f4695
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
|
|
|
|
| |
Change-Id: I281954d1f421c9aaaa9100a1505db0ba225cf488
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
| |
Change-Id: Id9ab6f3e9f5ae1c1bedb0b34bf1fac6abfe0bbfc
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Differences:
- push parameters on the stack, including space for CallData members
- call instructions calculate the argument start
- use temp space above the calldata to evaluate arguments
- fewer temporaries are needed when a call is done while generating the
arguments of another call
- when calling the function, the js stack space above the callData is
not used, allowing for optimizations in the future
- Array and ObjectLiteral use the same mechanism
Change-Id: Id100fa06f12cc9d941b0f90b0b81b8270a8e4f5d
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
| |
Make sure all libs and tests compile again after
the latest changes.
Change-Id: I749d3d2d0109cc97df2ecec93809ea8a1b3014a9
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
| |
Change-Id: I7d7845a9d8d147bd363c0f60df41066fab355272
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
|
|
|
| |
Implement exception handling, and make it conformant
with the spec.
Change-Id: I6d8222617180f96f628f18e11444488e50e5c043
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Replace Loop and ScopeAndFinally with a single ControlFlow
data structure, that can deal with non local control flow.
The control flow data structure can do required cleanup
of internal scopes (for catch or with), emit finally
statements and dispatch to the right continuation.
Also implemented support for the with statement again.
Change-Id: I8bb5414151d0312cb28f8d10e99f8d2b64484100
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
|
|
| |
These will simplify foreach and switch handling.
Change-Id: I7fb67481d7d1b82b03c03fd0987b182ea9542c7a
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
|
|
|
| |
Those Labels can be linked to a code location further ahead.
Change-Id: I82f1a719654162db0e0abb46df602ee2e01154da
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
| |
Change-Id: Ifcd57713e1cfa9514d3955e26f739a359cdaa8e5
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
|
|
|
|
|
|
|
| |
Add Label and Jump classes to facilitate the handling, and
resolve them to proper offsets at finalize() time.
Change-Id: Ic140a3ceb848fb29657a1b156c97b806db6dc434
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
|
|
|
|
|
| |
And a commented out finalize() call to the bytecodegenerator
Change-Id: Iaaf8981ee658e19b6816589d4340a8e5744764b7
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
|
Use the generator to store the list of instructions, labels
and patches. The finalize() method can then create the
final bytecode out of that list.
Change-Id: If2ea3118ed6e8744545bb918ecc4bbc87d6a3ff1
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|