| Commit message (Collapse) | Author | Age | Files | Lines |
| ... | |
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
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>
|
| | | |
| | |
| | |
| | |
| | | |
Change-Id: Ibefac50246045066c90c4c2dbc36d2776c5dab0e
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Do more checking for previous errors: evaluating a condition can
return an invalid result, because it might bail out because of an error.
Change-Id: I14709e48f00146baac9599320e436abb30acc938
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
Both in while-loops and in do-while-loops.
Change-Id: I50be52e3ea6ecb9ce6886e6da03c35a1790a45e8
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Consider the following functions:
function f(x) {
return x + (++x)
}
function g(x) {
return x + x
}
In f() it is not correct to delay the load of x on the left-hand side of
the + operator, while in g() it is. The reason is that calculating the
right-hand side of the + operator in f() will change the value of x.
So, if an argument is written to in an expression in a statement, it
cannot be delay-loaded. The same is true for member/field accesses,
because the accessors can be overwritten and do anything.
Change-Id: I5bed4b0d03919edc1c94a82127e2dd705fc1d9b1
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We need to use an activation context for signal handlers, because
parameter names are not explicitly stated, but loaded from the meta-
object. However, while compiling we don't know if a function is a signal
handler or not, so we need an activation context for all bindings.
Change-Id: Ia2fce3bcb1bc1abb11e74fedb429dda9205fa7e5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Instead simply use the pointer to the FunctionObject
we have in the CallData now.
Change-Id: I6d7ed8af22e89e0217bef427110611b661ac7965
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | | |
| | |
| | |
| | |
| | | |
Change-Id: Ie7f5f620089d58752d8f284293acda5794b4e99a
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| | | |
| | |
| | |
| | |
| | | |
Change-Id: Ia8f214e60f394f25235358b4ec529f78f4d3f263
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: I9a1b7d1ec9c0a66a34418ae3822b96c1c0d3eb86
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The stubs doing the calls often overwrite the value, and can in any
case do it more efficiently.
Change-Id: I0bb2fb3dcc34e805e0a4a178db02f99816d5cf46
Reviewed-by: Simon Hausmann <simon.hausmann@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>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Like this we can avoid creating Scope's when calling
functions.
Change-Id: I59b82c85eafd3a5437c233aba5f2e8330d5ce104
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
It didn't do anything special anymore, so fold the last
small bit of functionality back into the base class.
Change-Id: Ic8f62e645b2742aa91f13f63adaf321353962bc5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
There's no point in allocating that vector of byte arrays,
if we can directly embed those int the CompiledData and
reference it from there.
Change-Id: I8fc92b1efaca5a9646f40fc84a2ac4191c8f3444
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | | |
| | |
| | |
| | |
| | | |
Change-Id: Ia70727deb008021cbef6e546816b33ff0ce64afa
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We don't really need closure's to part of the Reference type.
Instead simply load them into the accumulator when needed,
and use a reference to the Accumulator instead.
Change-Id: I4ca8c60083c9f2fa0da1db6c3c53718e3a32fc6f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | | |
| | |
| | |
| | |
| | | |
Change-Id: I084979a6fef7cce9a825cae9ce57234583ceb3ce
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | | |
| | |
| | |
| | |
| | | |
Change-Id: I542ecabaaa9cd01bd1266456e317c842abd0a3de
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| | | |
| | |
| | |
| | |
| | | |
Change-Id: I54824554a908de4ac764d637fb43a0c79809c718
Reviewed-by: Lars Knoll <lars.knoll@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>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
To avoid additional overhead on most function calls
Change-Id: I2477b91fda6216b508c8331884a02b601f65590c
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Remove the unused Create/Construct instructions, and
rename the single remaining one to 'Construct'.
Change-Id: I10163a15681156f37e34d21a05d195d3c22adcff
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
| | | |
| | |
| | |
| | |
| | | |
Change-Id: Ib5d5dc3b0e4a67b950ca9804edd3b6434fcdf9d1
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
for comparisons with null or undefined.
Change-Id: I4a70d12ace501e4c4735b2ccfd6de19aeb9fef22
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
| | | |
| | |
| | |
| | |
| | | |
Change-Id: Ia040a5e0080e1619d5ec19a07138cf26e7a8086b
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
When using undefined/NaN as LHS instructions, we need to emit
them as global loads to get the correct runtime type error.
Amends c8a2e4acb101967c254d7e9d3c4e7d9f25c5eecc
Change-Id: Ic03fb88e43b4f1c7e5dfb99faa78e7d35a3a6f8a
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Delay desolving the name to an index until we actually need
it. This avoids storing strings that are never used in the string
table.
Change-Id: I935a2d07c03234097b4cf6cfe98231528ac3b15c
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
If the destination slot is known, there is no need to return and use it.
This also works around certain versions of GCC that won't recognize the
cast-to-void pattern to ignore return results.
Change-Id: Iabf7ab1141c4f606030f2dda10ef69d1b090fb72
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
as 0 is used quite often.
Change-Id: I2c952ef077590f6e6cfe9aad50807f5e0f8686e4
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
They are not used anymore.
Change-Id: I0cb3754899a30d5f88279ff31296fd73edf90a9a
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
| | | |
| | |
| | |
| | |
| | | |
Change-Id: Ib726d55a32d868a4a547b0530b8b6dc6cd99a3cf
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
| | | |
| | |
| | |
| | |
| | | |
Change-Id: Ia882e14f5521d45343288a267ffee5f756286012
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
Instead of falling back to the generic binop instruction.
Change-Id: Ib13014ee003eae6b25f6a5743fc52070af377255
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
| | | |
| | |
| | |
| | |
| | | |
Change-Id: Iab0b77328f5756972ef6eff82c0041b184290a32
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
undefined, Infinity and NaN can never be changed in the global
object, so we can directly resolve them to constants in the
parser.
Change-Id: I0cf43ff299518921d914121e150bc64ae5ea0c6e
Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Any code in a block or a SourceElementList that comes after a throw or
a return is unreachable and doesn't need any code generated. Also do not
generate an extra return for a function that ends with a throw.
Change-Id: I448e8172766ecfe9a2c5b8cff63ebad8b0657701
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
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>
|
| | | |
| | |
| | |
| | |
| | | |
Change-Id: I0b392040b6726e6d93f237ccccc9f053256ed819
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
There is actually no point in even having it in the context,
as it's immutable and can't become part of a closure.
Change-Id: I375fd07b9c442d667488430ebd246e174fdb243f
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | | |
| | |
| | |
| | |
| | | |
Change-Id: Ib8af10a48749b16c48d75c91ad215396b201a9d5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | | |
And adjust the name of the corresponding runtime functions.
Change-Id: I4adf7b0e069d9b0dff9162cd1271dafc60be854b
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Fix the push/pop context instructions to not modify the JS
stack anymore, as that can cause conflicts with the VME
(and was an ugly hack in any case). Instead, these instructions
not return the old context, that is then stored in a temporary.
Get rid of Engine::current and Engine::currentContext. The
StackFrame structures do now contain the only and authoritive
data. This finally gives us a nice setup where we create and
destroy frames on the stack when entering/leaving functions.
Change-Id: If161e3e941f59865c47ecfe1e094faf62b52bfa0
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
This cuts out quite a bit of overhead when entering
and leaving functions.
Change-Id: I32670c98a4087ea3b2d45853d9cabff9066399e8
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
We know at compile time whether an arguments object should be strict
or non strict (unmapped/mapped in ecmascript 6), use separate instructions
for both cases.
Change-Id: Ia23e68003beeda41a1f3597c0ba0980954c80ec7
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | | |
| | |
| | |
| | |
| | | |
Change-Id: Iac0fb5c955354c8137b551196278b822acc1b324
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The frame currently contains the function itself and the current
context.
Change-Id: I7d3402627fbc90e860a7bdc277585f365f5b4cb5
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|
| | | |
| | |
| | |
| | |
| | | |
Change-Id: I4744c9b39d4de599f02dd91622dd19713c8cc7eb
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
|