/*
- * Copyright (C) 2011, 2013, 2014 Apple Inc. All rights reserved.
+ * Copyright (C) 2011, 2013-2015 Apple Inc. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
return JSValueRegs(gpr);
}
+ static JSValueRegs withTwoAvailableRegs(GPRReg gpr, GPRReg)
+ {
+ return JSValueRegs(gpr);
+ }
+
bool operator!() const { return m_gpr == InvalidGPRReg; }
GPRReg gpr() const { return m_gpr; }
GPRReg tagGPR() const { return InvalidGPRReg; }
GPRReg payloadGPR() const { return m_gpr; }
+ bool uses(GPRReg gpr) const { return m_gpr == gpr; }
+
private:
GPRReg m_gpr;
};
{
}
+ static JSValueRegs withTwoAvailableRegs(GPRReg gpr1, GPRReg gpr2)
+ {
+ return JSValueRegs(gpr1, gpr2);
+ }
+
static JSValueRegs payloadOnly(GPRReg gpr)
{
return JSValueRegs(InvalidGPRReg, gpr);
return tagGPR();
}
+ bool uses(GPRReg gpr) const { return m_tagGPR == gpr || m_payloadGPR == gpr; }
+
private:
int8_t m_tagGPR;
int8_t m_payloadGPR;
return registerForIndex[index];
}
+ static GPRReg toArgumentRegister(unsigned)
+ {
+ UNREACHABLE_FOR_PLATFORM();
+ return InvalidGPRReg;
+ }
+
static unsigned toIndex(GPRReg reg)
{
ASSERT(reg != InvalidGPRReg);
static const GPRReg returnValueGPR = X86Registers::eax; // regT0
static const GPRReg returnValueGPR2 = X86Registers::edx; // regT1
static const GPRReg nonPreservedNonReturnGPR = X86Registers::esi;
+ static const GPRReg nonPreservedNonArgumentGPR = X86Registers::r10;
static const GPRReg patchpointScratchRegister = MacroAssembler::scratchRegister;
static GPRReg toRegister(unsigned index)
return registerForIndex[index];
}
+ static GPRReg toArgumentRegister(unsigned index)
+ {
+ ASSERT(index < numberOfArgumentRegisters);
+ static const GPRReg registerForIndex[numberOfArgumentRegisters] = { argumentGPR0, argumentGPR1, argumentGPR2, argumentGPR3 };
+ return registerForIndex[index];
+ }
+
static unsigned toIndex(GPRReg reg)
{
ASSERT(reg != InvalidGPRReg);
static const GPRReg returnValueGPR = ARM64Registers::x0; // regT0
static const GPRReg returnValueGPR2 = ARM64Registers::x1; // regT1
static const GPRReg nonPreservedNonReturnGPR = ARM64Registers::x2;
+ static const GPRReg nonPreservedNonArgumentGPR = ARM64Registers::x8;
static const GPRReg patchpointScratchRegister = ARM64Registers::ip0;
// GPRReg mapping is direct, the machine regsiter numbers can
static const char* debugName(GPRReg reg)
{
- ASSERT(static_cast<unsigned>(reg) != InvalidGPRReg);
+ ASSERT(reg != InvalidGPRReg);
ASSERT(static_cast<unsigned>(reg) < 32);
static const char* nameForRegister[32] = {
"r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",