aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jit
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2017-02-01 15:00:44 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2017-02-07 13:30:31 +0000
commitda35e3233335545125da51714298db6134cecb67 (patch)
treeea1275336a1b30752efe9da5ed548a3867d96aaa /src/qml/jit
parenteea43b5cc5aa6fab0d7523f92a83a5f75849782d (diff)
Fix register argument passing in cross-compiled code when host == x86
Replace the use of host-dependent pre-processor macro with variable usage from the target platform template specializations. Task-number: QTBUG-58577 Change-Id: I7e5ca4b79c2238954d6be7ec6b110eadd78a104d Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/jit')
-rw-r--r--src/qml/jit/qv4isel_masm.cpp9
-rw-r--r--src/qml/jit/qv4isel_masm_p.h2
-rw-r--r--src/qml/jit/qv4targetplatform_p.h6
3 files changed, 4 insertions, 13 deletions
diff --git a/src/qml/jit/qv4isel_masm.cpp b/src/qml/jit/qv4isel_masm.cpp
index 343062c1be..6769b22b77 100644
--- a/src/qml/jit/qv4isel_masm.cpp
+++ b/src/qml/jit/qv4isel_masm.cpp
@@ -114,11 +114,10 @@ void InstructionSelection<JITAssembler>::run(int functionIndex)
fpRegistersToSave.size());
_as->enterStandardStackFrame(regularRegistersToSave, fpRegistersToSave);
-#ifdef ARGUMENTS_IN_REGISTERS
- _as->move(_as->registerForArgument(0), JITTargetPlatform::EngineRegister);
-#else
- _as->loadPtr(addressForArgument(0), JITTargetPlatform::EngineRegister);
-#endif
+ if (JITTargetPlatform::RegisterArgumentCount > 0)
+ _as->move(_as->registerForArgument(0), JITTargetPlatform::EngineRegister);
+ else
+ _as->loadPtr(addressForArgument(0), JITTargetPlatform::EngineRegister);
_as->initializeLocalVariables();
diff --git a/src/qml/jit/qv4isel_masm_p.h b/src/qml/jit/qv4isel_masm_p.h
index 6ae50c3260..5c046cb397 100644
--- a/src/qml/jit/qv4isel_masm_p.h
+++ b/src/qml/jit/qv4isel_masm_p.h
@@ -155,7 +155,6 @@ protected:
using JITTargetPlatform = typename JITAssembler::JITTargetPlatform;
-#if !defined(ARGUMENTS_IN_REGISTERS)
Address addressForArgument(int index) const
{
// FramePointerRegister points to its old value on the stack, and above
@@ -163,7 +162,6 @@ protected:
// values before reaching the first argument.
return Address(JITTargetPlatform::FramePointerRegister, (index + 2) * sizeof(void*));
}
-#endif
Pointer baseAddressForCallArguments()
{
diff --git a/src/qml/jit/qv4targetplatform_p.h b/src/qml/jit/qv4targetplatform_p.h
index 4fc9d83059..fa01d911ef 100644
--- a/src/qml/jit/qv4targetplatform_p.h
+++ b/src/qml/jit/qv4targetplatform_p.h
@@ -132,7 +132,6 @@ public:
# define HAVE_ALU_OPS_WITH_MEM_OPERAND 1
static const int RegisterSize = 4;
-# undef ARGUMENTS_IN_REGISTERS
static const int RegisterArgumentCount = 0;
static RegisterID registerForArgument(int) { Q_UNREACHABLE(); }
@@ -218,7 +217,6 @@ public:
#define HAVE_ALU_OPS_WITH_MEM_OPERAND 1
static const int RegisterSize = 8;
-#define ARGUMENTS_IN_REGISTERS
static const int RegisterArgumentCount = 6;
static RegisterID registerForArgument(int index)
{
@@ -289,7 +287,6 @@ public:
#define HAVE_ALU_OPS_WITH_MEM_OPERAND 1
static const int RegisterSize = 8;
-#define ARGUMENTS_IN_REGISTERS
static const int RegisterArgumentCount = 4;
static RegisterID registerForArgument(int index)
{
@@ -395,7 +392,6 @@ public:
#undef HAVE_ALU_OPS_WITH_MEM_OPERAND
static const int RegisterSize = 4;
-#define ARGUMENTS_IN_REGISTERS
static const int RegisterArgumentCount = 4;
static RegisterID registerForArgument(int index)
{
@@ -518,7 +514,6 @@ public:
#undef HAVE_ALU_OPS_WITH_MEM_OPERAND
static const int RegisterSize = 8;
-#define ARGUMENTS_IN_REGISTERS
static const int RegisterArgumentCount = 8;
static RegisterID registerForArgument(int index)
{
@@ -608,7 +603,6 @@ public:
#undef HAVE_ALU_OPS_WITH_MEM_OPERAND
static const int RegisterSize = 4;
-#define ARGUMENTS_IN_REGISTERS
static const int RegisterArgumentCount = 4;
static RegisterID registerForArgument(int index)
{