diff options
author | Simon Hausmann <simon.hausmann@qt.io> | 2017-02-01 13:49:37 +0100 |
---|---|---|
committer | Simon Hausmann <simon.hausmann@qt.io> | 2017-02-07 12:11:37 +0000 |
commit | ff46a4127bbe46d9887457d5740e52ffff4d43d4 (patch) | |
tree | d98a21e0288df8d91f177f7f34b554209b5cb4cf /src/qml/jit/qv4targetplatform_p.h | |
parent | 9e926ddbf985f8d41747ae8a89ee3752a11011e4 (diff) |
Fix assembler cross-compilation on 32-bit hosts
The GOT register restoring logic needs to be done via TargetPLatform
members instead of plain #ifdefs.
Task-number: QTBUG-58569
Change-Id: If00d3f92558361ad5dcb20c3ff7eff78d31d75d3
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Diffstat (limited to 'src/qml/jit/qv4targetplatform_p.h')
-rw-r--r-- | src/qml/jit/qv4targetplatform_p.h | 27 |
1 files changed, 22 insertions, 5 deletions
diff --git a/src/qml/jit/qv4targetplatform_p.h b/src/qml/jit/qv4targetplatform_p.h index 46a618d733..4fc9d83059 100644 --- a/src/qml/jit/qv4targetplatform_p.h +++ b/src/qml/jit/qv4targetplatform_p.h @@ -145,10 +145,8 @@ public: #if OS(WINDOWS) || OS(QNX) || \ ((OS(LINUX) || OS(FREEBSD)) && (defined(__PIC__) || defined(__PIE__))) -#define RESTORE_EBX_ON_CALL - using Address = PlatformAssembler::Address; - static Address ebxAddressOnStack() - { + static const int gotRegister = JSC::X86Registers::ebx; + static int savedGOTRegisterSlotOnStack() { static int ebxIdx = -1; if (ebxIdx == -1) { int calleeSaves = 0; @@ -164,8 +162,11 @@ public: Q_ASSERT(ebxIdx >= 0); ebxIdx += 1; } - return Address(FramePointerRegister, ebxIdx * -int(sizeof(void*))); + return ebxIdx * -int(sizeof(void*)); } +#else + static const int gotRegister = -1; + static int savedGOTRegisterSlotOnStack() { return -1; } #endif }; #endif // x86 @@ -238,6 +239,9 @@ public: static const int StackSpaceAllocatedUponFunctionEntry = RegisterSize; // Return address is pushed onto stack by the CPU. static void platformEnterStandardStackFrame(PlatformAssembler *as) { as->push(FramePointerRegister); } static void platformLeaveStandardStackFrame(PlatformAssembler *as) { as->pop(FramePointerRegister); } + + static const int gotRegister = -1; + static int savedGOTRegisterSlotOnStack() { return -1; } }; #endif // Linux/MacOS on x86_64 @@ -304,6 +308,9 @@ public: static const int StackSpaceAllocatedUponFunctionEntry = RegisterSize; // Return address is pushed onto stack by the CPU. static void platformEnterStandardStackFrame(PlatformAssembler *as) { as->push(FramePointerRegister); } static void platformLeaveStandardStackFrame(PlatformAssembler *as) { as->pop(FramePointerRegister); } + + static const int gotRegister = -1; + static int savedGOTRegisterSlotOnStack() { return -1; } }; #endif // Windows on x86_64 @@ -418,6 +425,9 @@ public: as->pop(FramePointerRegister); as->pop(JSC::ARMRegisters::lr); } + + static const int gotRegister = -1; + static int savedGOTRegisterSlotOnStack() { return -1; } }; #endif // ARM (32 bit) @@ -540,6 +550,9 @@ public: { as->popPair(FramePointerRegister, JSC::ARM64Registers::lr); } + + static const int gotRegister = -1; + static int savedGOTRegisterSlotOnStack() { return -1; } }; #endif // ARM64 @@ -625,6 +638,10 @@ public: as->pop(FramePointerRegister); as->pop(JSC::MIPSRegisters::ra); } + + + static const int gotRegister = -1; + static int savedGOTRegisterSlotOnStack() { return -1; } }; #endif // Linux on MIPS (32 bit) |