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>
Hide the mapping from function argument to register in a small
section of the architecture specific code at the top of the
instruction selector and use a generic ArgumentLoader helper class
to first try loading function parameters in registers and then fall
back to the stack.
This is only tested on amd64 right now where we don't end up using
the stack right now, so it will need testing/tweaking for ia32/arm.
Change-Id: If073cd92a674e90dc28f2c9bdf2841bb07c020f1
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
The old functions that implement the old calling convention are unused now.
Change-Id: I8a6ba76c0ba2442f48a0dc331196ef399a902da0
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
This removes a link from the JIT code to the IR,
and should improve performance as we need slightly
less copies.
On 64 bit, Values are stores in 2 instructions instead
of 4 now.
Change-Id: I4a90165fcdfc2d77ac3f6e7e9accdef8600fadd6
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>
__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>
Generate integer Value's during instruction
selection. Value is already prepared for it,
so this simply speeds up integer heavy JS
execution.
Speeds up crypto.js by around 60%
Change-Id: I3781767fd5b5c799365f3c75245409a9760ae7fb
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Value's should be passed by value and returned by value between JIT
and the JS runtime. This should give us better performance on
x86_64 and ARM.
Change-Id: I4fa286c6164f0143adb72d07c737fa273c8a5eb6
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
Use != 0 instead of == 1, as it allows for a more efficient encoding
on ia32/amd64 (using test eax, eax)
Change-Id: I7a29139d8e6e9b843bf8df6f20f5ef7cc9b2e8cc
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
open_memstream is not supported beyond Linux it seems, so do the
symbol replacing disassembly printing only on Linux.
Change-Id: I1eff6db9e10bd0ebbc06e967a61f998ee42438a8
Reviewed-by: Erik Verbruggen <erik.verbruggen@digia.com>
Don't repeat calls to generateFunctionCall but use a helper macro to
get the name.
Change-Id: I394b1980cbd67f3ca94fc41402de2d5b99c45016
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
The old code was giving valgrind warnings, because
we loaded the boolean (1 byte) as a 32 bit integer.
Instead simply store all booleans as 32 bit ints
to avoid the warnings.
Change-Id: I46c7f9fc9d8dfe52afd9bab2dbab8923aaa630f8
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
qDebug() was used for part of the logging, which
uses stderr. Send everything else there as well.
Change-Id: I363dff3d2e4dd6f95bf0347f1df589ae2528fd32
Reviewed-by: Simon Hausmann <simon.hausmann@digia.com>
On ia32 sizeof(void*) < sizeof(Value), so we need to subtract
sizeof(Value) instead of sizeof(void*) before reaching the first
temp.
Added comments to explain the offsets.
Change-Id: Iefbb1dc762fdf36d73002c52dc9c471ec15ff403
Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Expect the boolean value to be in Gpr0, which means after the __qmljs_to_boolean
call the move(ReturnValueRegister, Gpr0) becomes a noop
* Instead of loading the true/1 into a register, use it as immediate value in the cmp
The position of temporaries on the stack was
off by 1, leading to us overwriting other r14, that gets
pushed to the stack after we have allocated space for temps.