Index: src/x64/macro-assembler-x64.cc |
diff --git a/src/x64/macro-assembler-x64.cc b/src/x64/macro-assembler-x64.cc |
index ea837dca4b014f4397428cdecc65db08b81cc42f..f41da95da76e9601bf11f96aed31cbb9ccfef601 100644 |
--- a/src/x64/macro-assembler-x64.cc |
+++ b/src/x64/macro-assembler-x64.cc |
@@ -10,6 +10,7 @@ |
#include "src/codegen.h" |
#include "src/debug/debug.h" |
#include "src/heap/heap.h" |
+#include "src/register-configuration.h" |
#include "src/x64/assembler-x64.h" |
#include "src/x64/macro-assembler-x64.h" |
@@ -729,7 +730,8 @@ void MacroAssembler::GetBuiltinEntry(Register target, |
} |
-#define REG(Name) { kRegister_ ## Name ## _Code } |
+#define REG(Name) \ |
+ { Register::kCode_##Name } |
static const Register saved_regs[] = { |
REG(rax), REG(rcx), REG(rdx), REG(rbx), REG(rbp), REG(rsi), REG(rdi), REG(r8), |
@@ -3710,12 +3712,14 @@ void MacroAssembler::EnterExitFrameEpilogue(int arg_stack_space, |
#endif |
// Optionally save all XMM registers. |
if (save_doubles) { |
- int space = XMMRegister::kMaxNumAllocatableRegisters * kDoubleSize + |
- arg_stack_space * kRegisterSize; |
+ int space = XMMRegister::kMaxNumRegisters * kDoubleSize + |
+ arg_stack_space * kRegisterSize; |
subp(rsp, Immediate(space)); |
int offset = -2 * kPointerSize; |
- for (int i = 0; i < XMMRegister::NumAllocatableRegisters(); i++) { |
- XMMRegister reg = XMMRegister::FromAllocationIndex(i); |
+ const RegisterConfiguration* config = RegisterConfiguration::ArchDefault(); |
+ for (int i = 0; i < config->num_allocatable_double_registers(); ++i) { |
+ DoubleRegister reg = |
+ DoubleRegister::from_code(config->GetAllocatableDoubleCode(i)); |
movsd(Operand(rbp, offset - ((i + 1) * kDoubleSize)), reg); |
} |
} else if (arg_stack_space > 0) { |
@@ -3758,8 +3762,10 @@ void MacroAssembler::LeaveExitFrame(bool save_doubles) { |
// r15 : argv |
if (save_doubles) { |
int offset = -2 * kPointerSize; |
- for (int i = 0; i < XMMRegister::NumAllocatableRegisters(); i++) { |
- XMMRegister reg = XMMRegister::FromAllocationIndex(i); |
+ const RegisterConfiguration* config = RegisterConfiguration::ArchDefault(); |
+ for (int i = 0; i < config->num_allocatable_double_registers(); ++i) { |
+ DoubleRegister reg = |
+ DoubleRegister::from_code(config->GetAllocatableDoubleCode(i)); |
movsd(reg, Operand(rbp, offset - ((i + 1) * kDoubleSize))); |
} |
} |