| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
| |
Properties in object literals are defined using
defineOwnProperty, so that they get set even if
the object prototype contains a non writable
property with the same name.
This fixes all remaining test cases for 11.1.5
Change-Id: I3928a144d09c51c5bf20a25bcb1c6c3c243975ee
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
| |
Implement support for defining accessor properties
through { ... }. Implementation for moth is pending.
Change-Id: I558b6811bc5656dc0fae78c49e23155043ce9cb1
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
|
| |
There was a bug in the implementation of unwindException(),
that caused failures when called twice from one catch statement.
Also refactor and simplify the TryStatement code further by
introducing a rethrow builtin.
Change-Id: I77bf37f1707042f402488ef2dfaf4e59bf8dc82a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
|
| |
In some cases, the first argument for runtime calls and the
return value where being placed in the same location on the
stack leading to corrupted return values. This mainly
happens when no local variable are defined, but other
functions are being called.
Change-Id: I93f1e518ce2998f62fb9f38c538dd718f41e522d
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
|
|
|
|
|
|
|
|
|
| |
Make sure we have the correct set of nested functions in
both IR::Function and VM::Function. This is required so
that closures can work correctly.
Change-Id: I42493d5ee503090653b71650c8d19e06c4bcfdda
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
| |
These operators have semantics that are different from
(foo + 1), as they always convert the LHS to a number first.
Change-Id: I3fb4a1a328e3dfcb334875435c3cec90d01b67dd
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
|
|
|
|
|
| |
Change-Id: I74f08976c046f7e8a6c16c786e6d32720ad88485
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
| |
Change-Id: Iab23eaa41f4ef4d3f99dccd6d2075fa4ba8e918e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
| |
-0 and +0 are two distinct numbers. Since integers only
have one 0 value, we need to convert the number to double
when negating a 0
Change-Id: I915c4bd7168eece947fa91c6b65137a873d4f75a
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
| |
This fixes potential leaks of IR::Functions, lowers the memory usage
of the functions that the VM needs (because the IR fields are not
present in the VM::Function), and makes both managed by the module
respectively the ExecutionEngine.
Change-Id: I6748ad98b062f994eae9dd14f1919aec5aa7c0b0
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
The isel is currently not reentrant because the MacroAssembler's instruction
output buffer is inaccessible and can only be reset by destroying the instance
and re-creating it.
This patch moves assembler specific code into an Assembler subclass and changes
isel to instantiate and use it instead of subclassing JSC::MacroAssembler.
Change-Id: Ic633214c67f475195202459698077e47a75ece2f
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
|
|
|
|
|
| |
Change-Id: I90cd2b34a25476dfee1ec01315275b6c179d11dc
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
| |
Change-Id: Ia3855625e72ae7ed50b9890edbad11e2aa338930
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
| |
Change-Id: I6034dad659ea4029256828bee06e8621902fd52c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
| |
Less namespacing, less clutter.
Change-Id: I08935413fc8dc021f2c207c2a8237067fd8f4c43
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
| |
Change-Id: I1e2703eaf1f8d4f5397690380ab6a76859ee1720
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
| |
Change-Id: Ibc5475030a68d9270e283aa8ac981661c590a29f
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
|
| |
Don't store pointers to the JSC::MacroAssembler functions directly in our
binops table but provide wrapper functions. Those can do operation specific
things, like in case of mul32 map from (imm, reg) to (imm, reg, reg) or
take care of overflow handling (needed for add/mul, but not shl/shr).
Change-Id: I63297c5be22c2b978b5dedabdc3baa5be0e586af
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
| |
Unfortunately this requires an extra entry in the info for the binary
op, because we can't do mul(imm, reg) only mul(imm, reg, reg).
Change-Id: I75beb3cb08ff24421483e824afaa9703befa488a
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
| |
We already do that conversion to a constant VM::Value earlier.
Change-Id: I142435f2be7c841f322ccfc34473b23cf85e6b5c
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of a gigantic switch and that duplicated across regular binop
and in-place binop, let's use one table where we can store all sorts
of meta-information about various aspects of the op implementations.
Then we can centralize the code for generating the inline operation
as well as the call to the fallback in one helper function.
Change-Id: I13b6dae7fd2a1490ae315689fa5f813eee83dd7b
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
| |
The class is a specification detail that we can implement
in a more performant way. ExecutionContext now contains
everything needed again.
Change-Id: Ideb5f04eeeecaf2b8543676c626e3943e4d6d7a1
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
| |
Change-Id: I4e54ae0feded8d99737245c870e0dfbb9b80247e
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Found out that the variableEnv is only required
for two use cases: To expose the exception in the
catch statement, and to create temporary
environments for the with() statment. Both can be
better handled differently and don't require the
overhead of two environments.
Change-Id: I149e1fd7bdfc3267544b141b6f94e46e42cf641b
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
|
|
|
|
|
|
|
|
| |
This fixes cases where eval() would create variables
in the wrong scope.
Change-Id: Ie93ec2d1fb125e588c1b6ffa2ca8ca4b6e3112c9
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
|
|
|
|
|
|
|
|
| |
Properly implement delete operator for identifiers
and local variables.
Change-Id: I8ac55edc80c31a94d11444c9f5c78caf4b131c95
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add the with object (list) to the environment, and check properties
there if it's available.
Generate IR statements implementing with() support.
Add two new builtin methods to enter and leave a with scope.
Implement support for the builtin's in masm.
Make sure exception handling works across with scopes.
Change-Id: I8257a16cfccc91a1acedfd740ade711b016b33fd
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
On ia32 the return VM value doesn't fit into a register. Instead the
caller provides a pointer to where the return value can be stored
as a first invisible argument. This is where we then copy the return
value to. It is the callee's responsibility to remove that one invisible
argument from the stack. Usually this is done using a "ret <n>" instruction,
which however masm doesn't support, so we emulate it. That might not be
any slower, since it's kind of replacing the CISC ret <n> instruction with
RISC :)
Change-Id: I4cb842e5a0a95a3d52867e66216dd711d627cf25
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
| |
This fixes a regression in MOTH.
Change-Id: Icd9e2ebf49ab6190bf932a94da03c4171c8d9c61
Reviewed-by: Lars Knoll <lars.knoll@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>
|
|
|
|
|
| |
Change-Id: Ic12a54ab1c5789cc5684d38961c58f6b34f9597a
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
|
|
|
|
|
|
|
|
|
|
|
| |
This allows us to use expressions such as
%x = %y + const
in the IR.
This still requires an implementation for moth.
Change-Id: I134e96ddad08bcbe4f3ea5fa27c5338a96acac80
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
|
|
|
|
|
| |
Change-Id: I61e91701bbaa173c8189af9f703ac2b509b99cd0
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>
|
|
|
|
|
| |
Change-Id: I8f3c8add78bebf92e0073348d1ecbdf3f328af6d
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
| |
And vice-versa, so drop the wrapping if statement.
Change-Id: I57b7aef23feeee6b3f94edd5ca85bfc460bb2307
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
| |
Aligning on 16 byte boundaries is a requirement for MacOS, and it gives
the optimal performance when using MMX on stack allocated data.
Change-Id: I1c9a27e796f1c240002a05196490f15df68c3f73
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Functions like loadArgument and storeValue that work right above
the macro assembler may use ScratchRegister because they only call
functions that do not "allocate" that register themselves.
copyValue on the other hand is a higher-level function and may not use
ScratchRegister because the functions it calls (i.e. loadArgument)
may clobber it. In the 64-bit case of quickly copying one VM value
to another location, we might as well use the ReturnValueRegister
as intermediate register and therefore re-allow the use of ScratchRegister
in the lower-level loadArgument/storeArgument functions.
Change-Id: I9f0c0d326e5af87101972f0cceb86cffe4ebdd0d
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
| |
Instead introduce a ScratchRegister which is explicitly different from
the ReturnValueRegister and is therefore safe to use.
Change-Id: I4675b6a4d242f3e02a4e848c7b65660ffa97cfe6
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
|
|
|
|
| |
We don't need to explicitly operate on Gpr0 for the return value when we can
use the ReturnValueRegister alias instead. No change in code generation because
on Amd64 and Ia32 Gpr0 == ReturnValueRegister.
Change-Id: Ia21613a51878093a9fb425879645ea3b8a4dbf72
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
| |
Change-Id: I86c9bbe69c9ba4ae9d300b62e7d16b372f3478ea
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Remove the inheritance from ValueData and ValueBase.
Use a few ifdef's for 64 bit instead of a lot of
template magic and inheritance to get the correct
implementations for 32 and 64 bit.
Saves some code, and makes Value a real POD type.
Apparently this also helps gcc generate better code,
crypto.js runs another few percent faster now.
Change-Id: I9dac488b27e629e6ef8c096f2bee86a5d678fd49
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
| |
Change-Id: I6cd282d5780e418bea7a07d4639c035a98b3ed65
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
| |
Change-Id: Ifaef87046c083b36222f6204291ee3a61ffcd20b
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|
|
|
|
|
|
|
| |
Pass it up to generateFunctionCall :)
Change-Id: Ic05854e2a7b8bea09eb652e37df43587ffe62824
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
|
|
|
|
|
| |
Change-Id: I9f5d4cb6a7db0cd63c419cdf41c1a7497453559e
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
|