Index: src/arm/deoptimizer-arm.cc |
diff --git a/src/arm/deoptimizer-arm.cc b/src/arm/deoptimizer-arm.cc |
index 19667b9d5f44bf9645bf3d5049d3081a191b795b..321004e600900903e80869c21ee451c0ab999453 100644 |
--- a/src/arm/deoptimizer-arm.cc |
+++ b/src/arm/deoptimizer-arm.cc |
@@ -888,7 +888,7 @@ void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) { |
} |
input_->SetRegister(sp.code(), reinterpret_cast<intptr_t>(frame->sp())); |
input_->SetRegister(fp.code(), reinterpret_cast<intptr_t>(frame->fp())); |
- for (int i = 0; i < DoubleRegister::kNumAllocatableRegisters; i++) { |
+ for (int i = 0; i < DoubleRegister::NumAllocatableRegisters(); i++) { |
input_->SetDoubleRegister(i, 0.0); |
} |
@@ -916,23 +916,30 @@ void Deoptimizer::EntryGenerator::Generate() { |
RegList restored_regs = kJSCallerSaved | kCalleeSaved | ip.bit(); |
const int kDoubleRegsSize = |
- kDoubleSize * DwVfpRegister::kNumAllocatableRegisters; |
+ kDoubleSize * DwVfpRegister::NumAllocatableRegisters(); |
// Save all VFP registers before messing with them. |
DwVfpRegister first = DwVfpRegister::FromAllocationIndex(0); |
DwVfpRegister last = |
DwVfpRegister::FromAllocationIndex( |
- DwVfpRegister::kNumAllocatableRegisters - 1); |
+ DwVfpRegister::NumAllocatableRegisters() - 1); |
ASSERT(last.code() > first.code()); |
- ASSERT((last.code() - first.code()) == |
- (DwVfpRegister::kNumAllocatableRegisters - 1)); |
+ //ASSERT((last.code() - first.code()) == |
+ // (DwVfpRegister::NumAllocatableRegisters() - 1)); |
#ifdef DEBUG |
- for (int i = 0; i <= (DwVfpRegister::kNumAllocatableRegisters - 1); i++) { |
+ for (int i = 0; i <= (DwVfpRegister::NumAllocatableRegisters() - 1); i++) { |
ASSERT((DwVfpRegister::FromAllocationIndex(i).code() <= last.code()) && |
(DwVfpRegister::FromAllocationIndex(i).code() >= first.code())); |
} |
#endif |
- __ vstm(db_w, sp, first, last); |
+ ASSERT(DwVfpRegister::ScratchReg().code() == DwVfpRegister::ZeroReg().code() + 1); |
+ if (last.code() > DwVfpRegister::ScratchReg().code()) { |
+ // This happens when we also have d16-d31 available. |
+ __ vstm(db_w, sp, first, DwVfpRegister::from_code(DwVfpRegister::ZeroReg().code() - 1)); |
+ __ vstm(db_w, sp, DwVfpRegister::from_code(DwVfpRegister::ScratchReg().code() + 1), last); |
+ } else { |
+ __ vstm(db_w, sp, first, last); |
+ } |
// Push all 16 registers (needed to populate FrameDescription::registers_). |
// TODO(1588) Note that using pc with stm is deprecated, so we should perhaps |
@@ -994,7 +1001,7 @@ void Deoptimizer::EntryGenerator::Generate() { |
// Copy VFP registers to |
// double_registers_[DoubleRegister::kNumAllocatableRegisters] |
int double_regs_offset = FrameDescription::double_registers_offset(); |
- for (int i = 0; i < DwVfpRegister::kNumAllocatableRegisters; ++i) { |
+ for (int i = 0; i < DwVfpRegister::NumAllocatableRegisters(); ++i) { |
int dst_offset = i * kDoubleSize + double_regs_offset; |
int src_offset = i * kDoubleSize + kNumberOfRegisters * kPointerSize; |
__ vldr(d0, sp, src_offset); |