Index: src/mips/macro-assembler-mips.cc |
diff --git a/src/mips/macro-assembler-mips.cc b/src/mips/macro-assembler-mips.cc |
index 9249917c3fd0e00895ef9eef6060079236c7bfe3..41e44b6a357d8cd044e1fca37eff553421488dc2 100644 |
--- a/src/mips/macro-assembler-mips.cc |
+++ b/src/mips/macro-assembler-mips.cc |
@@ -118,8 +118,8 @@ void MacroAssembler::PopSafepointRegisters() { |
void MacroAssembler::PushSafepointRegistersAndDoubles() { |
PushSafepointRegisters(); |
- Subu(sp, sp, Operand(FPURegister::kNumAllocatableRegisters * kDoubleSize)); |
- for (int i = 0; i < FPURegister::kNumAllocatableRegisters; i+=2) { |
+ Subu(sp, sp, Operand(FPURegister::NumAllocatableRegisters() * kDoubleSize)); |
+ for (int i = 0; i < FPURegister::NumAllocatableRegisters(); i+=2) { |
FPURegister reg = FPURegister::FromAllocationIndex(i); |
sdc1(reg, MemOperand(sp, i * kDoubleSize)); |
} |
@@ -127,11 +127,11 @@ void MacroAssembler::PushSafepointRegistersAndDoubles() { |
void MacroAssembler::PopSafepointRegistersAndDoubles() { |
- for (int i = 0; i < FPURegister::kNumAllocatableRegisters; i+=2) { |
+ for (int i = 0; i < FPURegister::NumAllocatableRegisters(); i+=2) { |
FPURegister reg = FPURegister::FromAllocationIndex(i); |
ldc1(reg, MemOperand(sp, i * kDoubleSize)); |
} |
- Addu(sp, sp, Operand(FPURegister::kNumAllocatableRegisters * kDoubleSize)); |
+ Addu(sp, sp, Operand(FPURegister::NumAllocatableRegisters() * kDoubleSize)); |
PopSafepointRegisters(); |
} |
@@ -167,7 +167,7 @@ MemOperand MacroAssembler::SafepointRegisterSlot(Register reg) { |
MemOperand MacroAssembler::SafepointRegistersAndDoublesSlot(Register reg) { |
UNIMPLEMENTED_MIPS(); |
// General purpose registers are pushed last on the stack. |
- int doubles_size = FPURegister::kNumAllocatableRegisters * kDoubleSize; |
+ int doubles_size = FPURegister::NumAllocatableRegisters() * kDoubleSize; |
int register_offset = SafepointRegisterStackIndex(reg.code()) * kPointerSize; |
return MemOperand(sp, doubles_size + register_offset); |
} |
@@ -4249,7 +4249,10 @@ void MacroAssembler::CallRuntimeSaveDoubles(Runtime::FunctionId id) { |
const Runtime::Function* function = Runtime::FunctionForId(id); |
PrepareCEntryArgs(function->nargs); |
PrepareCEntryFunction(ExternalReference(function, isolate())); |
- CEntryStub stub(1, kSaveFPRegs); |
+ SaveFPRegsMode mode = CpuFeatures::IsSupported(FPU) |
+ ? kSaveFPRegs |
+ : kDontSaveFPRegs; |
+ CEntryStub stub(1, mode); |
CallStub(&stub); |
} |