It's easier to store this in the engine then
in the execution context.
Change-Id: I01ff447602a7d785165e774bdf6e1735c073be2d
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
The result variable in the context is not really
required, as we can return results directly in the
return value register.
Change-Id: I12554c228500aa24625ef82e31fd7f72989a71bb
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
A factory is now passed along to do the codegen for eval().
Change-Id: If15b1f28c9c0a8f8b6d18b56d6e7bc5d942927e5
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
Make the ExecutionContext standard compliant.
Move most of it's members into a new
DeclarativeEnvironment data structure that
contains locals and arguments.
Change-Id: I094f559168810dbd3717d677fe28750076015976
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
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>
Still doesn't work correctly, as we can't modify
the global context there.
Change-Id: Ifd0ab217c3cf2d0c1b86f09907b440ea31c29ac8
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>
Instead of silently failing, which is a bit ambiguous in case of test262.
Change-Id: I8b8dc066df63f93273ccc6c27547edfcd1a68cb7
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
While in that area of code, also throw in the pass-managers for
some extra optimisations during compilation.
Change-Id: I1239ab9d21fc50b2e65c2f9d77a03ae593b607bc
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
The different backends can now be selected by command-line options,
and when none is specified, masm is used. The difference is that the
environment variable USE_MOTH is not used anymore.
The return codes are 0 or -1, so the test harness can easily check for
errors.
The ECMA test262 harness uses the $ERROR function to report errors. When
the environment variable IN_TEST_HARNESS is set, this function will get
added to the global object.
Change-Id: I291c72332ea50892afb99f9a0a15004ffc81c200
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>
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>
Remove __qmljs_init_object and replace it with
Value::fromObject
Change-Id: Ibc8bd9e7ecd56c6713dc08add72e5cd35ffea78e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
All JS types are now encoded in a 8 byte data
structure. We use the 52 bits that are unused
when a double is a NaN to encode all other types
that can be stored inside a double.
This is being done by using a few bits to determine
the type, and up to 48 bits for data. This works
even on x64, as addresses (ie. pointers) are limited
to 48 bits on these platforms.
For most other types (except doubles), we store the
data in the lower 32 bits of the double.