Index: src/arm/code-stubs-arm.h |
diff --git a/src/arm/code-stubs-arm.h b/src/arm/code-stubs-arm.h |
index 0443cf799cc08e5d83e8ebe88f6de929dc8b5d12..a5aebee946fac1525f39dae88de7c88c53173f06 100644 |
--- a/src/arm/code-stubs-arm.h |
+++ b/src/arm/code-stubs-arm.h |
@@ -472,9 +472,11 @@ class RecordWriteStub: public CodeStub { |
CpuFeatures::Scope scope(VFP2); |
masm->sub(sp, |
sp, |
- Operand(kDoubleSize * (DwVfpRegister::kNumRegisters - 1))); |
+ Operand(kDoubleSize * |
+ (DwVfpRegister::NumAvailableRegisters() - 1))); |
// Save all VFP registers except d0. |
- for (int i = DwVfpRegister::kNumRegisters - 1; i > 0; i--) { |
+ // TODO(hans): We should probably save d0 too. And maybe use vstm. |
+ for (int i = DwVfpRegister::NumAvailableRegisters() - 1; i > 0; i--) { |
DwVfpRegister reg = DwVfpRegister::from_code(i); |
masm->vstr(reg, MemOperand(sp, (i - 1) * kDoubleSize)); |
} |
@@ -486,13 +488,15 @@ class RecordWriteStub: public CodeStub { |
if (mode == kSaveFPRegs) { |
CpuFeatures::Scope scope(VFP2); |
// Restore all VFP registers except d0. |
- for (int i = DwVfpRegister::kNumRegisters - 1; i > 0; i--) { |
+ // TODO(hans): We should probably restore d0 too. And maybe use vldm. |
+ for (int i = DwVfpRegister::NumAvailableRegisters() - 1; i > 0; i--) { |
DwVfpRegister reg = DwVfpRegister::from_code(i); |
masm->vldr(reg, MemOperand(sp, (i - 1) * kDoubleSize)); |
} |
masm->add(sp, |
sp, |
- Operand(kDoubleSize * (DwVfpRegister::kNumRegisters - 1))); |
+ Operand(kDoubleSize * |
+ (DwVfpRegister::NumAvailableRegisters() - 1))); |
} |
masm->ldm(ia_w, sp, (kCallerSaved | lr.bit()) & ~scratch1_.bit()); |
} |