aboutsummaryrefslogtreecommitdiffstats
path: root/src/qml/jit/qv4targetplatform_p.h
diff options
context:
space:
mode:
authorSimon Hausmann <simon.hausmann@qt.io>2017-01-09 16:11:36 +0100
committerSimon Hausmann <simon.hausmann@qt.io>2017-01-28 19:04:01 +0000
commitf2c92c5ccdf6789ddc00ec14ec9e399c6a431a9b (patch)
treea7e889efc6ff506071f235a670716ddb728a0f8d /src/qml/jit/qv4targetplatform_p.h
parentd0cb0daed5217de2a2bc180f3ad2fb3344df21c1 (diff)
Make QV4::JIT::TargetPlatform a template
In the future we're going to need different specializations of that depending on the target platform chosen at run-time. Change-Id: I2ed6f41c3eb0487d83afee01f81b78361678dfd9 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.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/qml/jit/qv4targetplatform_p.h b/src/qml/jit/qv4targetplatform_p.h
index 82ff7cebaf..4179e88e93 100644
--- a/src/qml/jit/qv4targetplatform_p.h
+++ b/src/qml/jit/qv4targetplatform_p.h
@@ -79,12 +79,12 @@ namespace JIT {
// a call, we add a load it right before emitting the call instruction.
//
// NOTE: When adding new architecture, do not forget to whitelist it in qv4global_p.h!
+template <typename PlatformAssembler>
class TargetPlatform
{
public:
- typedef JSC::MacroAssembler PlatformAssembler;
- using RegisterID = PlatformAssembler::RegisterID;
- using FPRegisterID = PlatformAssembler::FPRegisterID;
+ using RegisterID = typename PlatformAssembler::RegisterID;
+ using FPRegisterID = typename PlatformAssembler::FPRegisterID;
#if CPU(X86) && (OS(LINUX) || OS(WINDOWS) || OS(QNX) || OS(FREEBSD) || defined(Q_OS_IOS))
enum { RegAllocIsSupported = 1 };
@@ -133,7 +133,8 @@ public:
((OS(LINUX) || OS(FREEBSD)) && (defined(__PIC__) || defined(__PIE__)))
#define RESTORE_EBX_ON_CALL
- static PlatformAssembler::Address ebxAddressOnStack()
+ using Address = typename PlatformAssembler::Address;
+ static Address ebxAddressOnStack()
{
static int ebxIdx = -1;
if (ebxIdx == -1) {
@@ -150,7 +151,7 @@ public:
Q_ASSERT(ebxIdx >= 0);
ebxIdx += 1;
}
- return PlatformAssembler::Address(FramePointerRegister, ebxIdx * -int(sizeof(void*)));
+ return Address(FramePointerRegister, ebxIdx * -int(sizeof(void*)));
}
#endif