Index: src/arm/code-stubs-arm.cc |
diff --git a/src/arm/code-stubs-arm.cc b/src/arm/code-stubs-arm.cc |
index 521231c02ab7efb5db9720fde2630983492204e3..eb697e4a20164e76f8da48d7816410141d78b28e 100644 |
--- a/src/arm/code-stubs-arm.cc |
+++ b/src/arm/code-stubs-arm.cc |
@@ -2066,17 +2066,25 @@ void StoreBufferOverflowStub::Generate(MacroAssembler* masm) { |
// store the registers in any particular way, but we do have to store and |
// restore them. |
__ stm(db_w, sp, kCallerSaved | lr.bit()); |
+ |
+ const Register scratch = r1; |
+ |
if (save_doubles_ == kSaveFPRegs) { |
CpuFeatures::Scope scope(VFP2); |
+ // Check CPU flags for number of registers. |
+ // 16 regs => Z==1, 32 regs => Z==0. |
+ __ mov(scratch, Operand(ExternalReference::cpu_features())); |
+ __ ldr(scratch, MemOperand(scratch)); |
+ __ and_(scratch, scratch, Operand(1u << VFP32DREGS), SetCC); |
+ |
__ sub(sp, sp, Operand(kDoubleSize * DwVfpRegister::kNumRegisters)); |
for (int i = 0; i < DwVfpRegister::kNumRegisters; i++) { |
DwVfpRegister reg = DwVfpRegister::from_code(i); |
- __ vstr(reg, MemOperand(sp, i * kDoubleSize)); |
+ __ vstr(reg, MemOperand(sp, i * kDoubleSize), i < 16 ? al : ne); |
} |
} |
const int argument_count = 1; |
const int fp_argument_count = 0; |
- const Register scratch = r1; |
AllowExternalCallThatCantCauseGC scope(masm); |
__ PrepareCallCFunction(argument_count, fp_argument_count, scratch); |
@@ -2086,9 +2094,16 @@ void StoreBufferOverflowStub::Generate(MacroAssembler* masm) { |
argument_count); |
if (save_doubles_ == kSaveFPRegs) { |
CpuFeatures::Scope scope(VFP2); |
+ |
+ // Check CPU flags for number of registers. |
+ // 16 regs => Z==1, 32 regs => Z==0. |
+ __ mov(scratch, Operand(ExternalReference::cpu_features())); |
+ __ ldr(scratch, MemOperand(scratch)); |
+ __ and_(scratch, scratch, Operand(1u << VFP32DREGS), SetCC); |
+ |
for (int i = 0; i < DwVfpRegister::kNumRegisters; i++) { |
DwVfpRegister reg = DwVfpRegister::from_code(i); |
- __ vldr(reg, MemOperand(sp, i * kDoubleSize)); |
+ __ vldr(reg, MemOperand(sp, i * kDoubleSize), i < 16 ? al : ne); |
} |
__ add(sp, sp, Operand(kDoubleSize * DwVfpRegister::kNumRegisters)); |
} |