Index: src/arm/macro-assembler-arm.cc |
diff --git a/src/arm/macro-assembler-arm.cc b/src/arm/macro-assembler-arm.cc |
index bcc985ac5a074e9ae14892d159e5c7cd1afd52b4..90601952299e31a4210e2b9dccbbb489991a45c8 100644 |
--- a/src/arm/macro-assembler-arm.cc |
+++ b/src/arm/macro-assembler-arm.cc |
@@ -620,22 +620,26 @@ void MacroAssembler::PushSafepointRegistersAndDoubles() { |
// Number of d-regs not known at snapshot time. |
ASSERT(!Serializer::enabled()); |
PushSafepointRegisters(); |
- sub(sp, sp, Operand(DwVfpRegister::NumAllocatableRegisters() * |
- kDoubleSize)); |
- for (int i = 0; i < DwVfpRegister::NumAllocatableRegisters(); i++) { |
- vstr(DwVfpRegister::FromAllocationIndex(i), sp, i * kDoubleSize); |
+ // Only save allocatable registers. |
+ ASSERT(kScratchDoubleReg.is(d15) && kDoubleRegZero.is(d14)); |
+ ASSERT(DwVfpRegister::NumReservedRegisters() == 2); |
+ if (CpuFeatures::IsSupported(VFP32DREGS)) { |
+ vstm(db_w, sp, d16, d31); |
} |
+ vstm(db_w, sp, d0, d13); |
} |
void MacroAssembler::PopSafepointRegistersAndDoubles() { |
// Number of d-regs not known at snapshot time. |
ASSERT(!Serializer::enabled()); |
- for (int i = 0; i < DwVfpRegister::NumAllocatableRegisters(); i++) { |
- vldr(DwVfpRegister::FromAllocationIndex(i), sp, i * kDoubleSize); |
+ // Only save allocatable registers. |
+ ASSERT(kScratchDoubleReg.is(d15) && kDoubleRegZero.is(d14)); |
+ ASSERT(DwVfpRegister::NumReservedRegisters() == 2); |
+ vldm(ia_w, sp, d0, d13); |
+ if (CpuFeatures::IsSupported(VFP32DREGS)) { |
+ vldm(ia_w, sp, d16, d31); |
} |
- add(sp, sp, Operand(DwVfpRegister::NumAllocatableRegisters() * |
- kDoubleSize)); |
PopSafepointRegisters(); |
} |