This is so it'll map to the name used in the
ECMAScript spec once the other refactorings
are in.
Change-Id: I8dcc7ad43b457ce50e7123c57bc4c770bcda8d11
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Stop using QString::toDouble, because it doesn't handle Infinity,
-Infinity, 10e10000, etc.
Change-Id: Ic51bc1d7fe4d2d233b551b87d48833f3ba76a6dc
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Only the instruction pointer and targetTempIndex are needed.
Change-Id: I21279d68e74dac42d875e3ced9004e9d3c42c29d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Make the initialization for call() compliant
with the standard, and add a strict mode boolean.
Change-Id: I8617af8dbfde47d8b2a8a0a7ce0ab491031ba4ba
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
The activation object inside the context is always an object,
or null. This avoids some needless conversions to and from
Value's.
Change-Id: Ibbd88c83fa073a4ed3cf03742129357dd9567cec
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
The stack frame of the interpreting function is restored, but all the
datastructures live on the heap. So, save them out on handler creation,
and restore them afterwards.
Change-Id: I84b84007cc9944b56926bf0387c2798f7841cd2a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Remove a lot of duplicated code, and make it a lot
easier to implement JS compliant semantics.
Change-Id: Ic5ecb58d34a5df8fe05e86c5f906d70c50c51b54
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Fix the last parts of the inplace bitops to
do the correct thing.
Change-Id: I748dde919082193c034cdc20e92cc568d8efa225
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Add a generic method to handle binops such as +=
to Object and use it. We can probably remove
most of the __qmljs_inplace_xxx methods later
on and call one generic method instead.
Change-Id: If7cbd2e3012ad381e29b9eec2059e17f02a0a38a
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Implement proper call() and construct()
methods in FunctionObject, and remove
some duplicated initialization code.
Change-Id: I5c86f9f2cf6e4b65d23d000149db2b79c35538c4
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Implement the more general foo[expr] op= bar
Change-Id: Idb2143cfe4b48fc9ce177d699970818e877dc735
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
This doesn't quite fix all issues, as activation records
and arguments objects will still not work correctly in
all cases (esp. the inplace operators).
Change-Id: I0ebf2a08e6c61e4049d4b6f449987757bfc3f81c
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
And don't dump the assemply unless SHOW_CODE is set.
Change-Id: I17ad36f002404b57c65f910048e5c82d42307976
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
See section 8.12 of the standard. This implements
8.12.1 - 8.12.7 and 8.12.9
Also gave these methods standard conformant names.
They are marked as [[foo]] in the standard, which
translates to __foo__ in our code.
Change-Id: I1990d6c6dd24e929c23d5c51d36f1e2e0a0a3b63
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
This implements Section 9.11 of the spec.
Also simplify __qmljs_strict_equal().
Change-Id: I99b33308c33f4d4732b4a72bd5327336b2b22257
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
This brings the basic structure or accessing properties
more in line with the EcmaScript 5.1 specification.
There's however still quite some work to be done to
make things fully compliant.
Change-Id: If55afd7ae6e4f7aa5ce06afe49b1453b537ac98b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
They differ from the isObject/isUndefined/etc. methods because they do
an extra virtual function call. And with isObject and friends being
cheap, is*Object methods could have made the same (but faulty)
impression.
Change-Id: I32f26a96e73251bd14f8198b0a1ffb5d59e53f31
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
The main change is renaming __qmljs_call_function to callFunction, and
move duplicate error checking in there. Now __qmljs_call_value does not
do its own call anymore, but calls __qmljs_call_function. All calls to
__qmljs_call_function are replaced by calls to __qmljs_call_value.
Change-Id: I7fffc2e811c43e84e7344d70e2ed521331ed710d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Implement exceptions using setjmp/longjmp. The
advantage is that this removes all exception
handling overhead from regular code, the only
code that still has a (very small) overhead
is the try{} catch() {} statement.
Change-Id: I43d6a60dfc9dfd4b7a20d2e99ab0a9315b4d8a2f
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Simplify and optimise the Value::isXxx() methods
at the same time.
Change-Id: I3e8fa98cf7b91079a4450c048c6d0795d1684724
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Remove __qmljs_init_object and replace it with
Value::fromObject
Change-Id: Ibc8bd9e7ecd56c6713dc08add72e5cd35ffea78e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Change-Id: Ic36761b9ee95c7b51b0eb2c23daa01084d316067
Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Passing const values doesn't make a whole lot of sense,
esp. when the passed object is POD.
Change-Id: I7372407862828cf7fa8461583069743ecf583170
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Implemented a few stubs for qmljs_inplace_op_member
Change-Id: I542a535862339285db7ec0b547754453545a3dc0
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
At least on MacOS, but possibly elsewhere too, including cmath before or
after math.h will undefine e.g. the isinf macro (and others). The math.h
include headers will make sure that math.h cannot get included twice,
so this will end with a situation where isinf is undefined, but
std::isinf is there.
Change-Id: Ie59aeadf2adde511ea8db5eb2fafd3272a7e9d51
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
__qmljs_call_value was still using a pointer to a Value.
In addition, qcv4isel_masm.cpp was using a wrong order
of the arguments.
Change-Id: I0414aa732ae8074420e4f11525f5b04712cc1bab
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
This helps in the interpretation of the type returned
by a method. It also makes it easier to later on change
the type back to a real bool if it makes sense. Bool
is currently typedef'ed to uint.
Change-Id: I905d828f4f7b0f7e778b7f197c4ed61117ce5d16
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>