Index: src/ppc/deoptimizer-ppc.cc |
diff --git a/src/ppc/deoptimizer-ppc.cc b/src/ppc/deoptimizer-ppc.cc |
index b96dc6fece90e3d9de6d8d0ce02b582d6732b300..c8ad31cf2ab14216163bbc918c215ec0c8f8f614 100644 |
--- a/src/ppc/deoptimizer-ppc.cc |
+++ b/src/ppc/deoptimizer-ppc.cc |
@@ -121,6 +121,7 @@ void Deoptimizer::TableEntryGenerator::Generate() { |
RegList saved_regs = restored_regs | sp.bit(); |
const int kDoubleRegsSize = kDoubleSize * DoubleRegister::kNumRegisters; |
+ const int kFloatRegsSize = kFloatSize * FloatRegister::kNumRegisters; |
// Save all double registers before messing with them. |
__ subi(sp, sp, Operand(kDoubleRegsSize)); |
@@ -131,6 +132,14 @@ void Deoptimizer::TableEntryGenerator::Generate() { |
int offset = code * kDoubleSize; |
__ stfd(dreg, MemOperand(sp, offset)); |
} |
+ // Save all float registers before messing with them. |
+ __ subi(sp, sp, Operand(kFloatRegsSize)); |
+ for (int i = 0; i < config->num_allocatable_float_registers(); ++i) { |
+ int code = config->GetAllocatableFloatCode(i); |
+ const FloatRegister freg = FloatRegister::from_code(code); |
+ int offset = code * kFloatSize; |
+ __ stfs(freg, MemOperand(sp, offset)); |
+ } |
// Push saved_regs (needed to populate FrameDescription::registers_). |
// Leave gaps for other registers. |
@@ -145,7 +154,7 @@ void Deoptimizer::TableEntryGenerator::Generate() { |
__ StoreP(fp, MemOperand(ip)); |
const int kSavedRegistersAreaSize = |
- (kNumberOfRegisters * kPointerSize) + kDoubleRegsSize; |
+ (kNumberOfRegisters * kPointerSize) + kDoubleRegsSize + kFloatRegsSize; |
// Get the bailout id from the stack. |
__ LoadP(r5, MemOperand(sp, kSavedRegistersAreaSize)); |
@@ -196,11 +205,21 @@ void Deoptimizer::TableEntryGenerator::Generate() { |
for (int i = 0; i < config->num_allocatable_double_registers(); ++i) { |
int code = config->GetAllocatableDoubleCode(i); |
int dst_offset = code * kDoubleSize + double_regs_offset; |
- int src_offset = code * kDoubleSize + kNumberOfRegisters * kPointerSize; |
+ int src_offset = |
+ code * kDoubleSize + kNumberOfRegisters * kPointerSize + kFloatRegsSize; |
__ lfd(d0, MemOperand(sp, src_offset)); |
__ stfd(d0, MemOperand(r4, dst_offset)); |
} |
- |
+ int float_regs_offset = FrameDescription::float_registers_offset(); |
+ // Copy float registers to |
+ // float_registers_[FloatRegister::kNumRegisters] |
+ for (int i = 0; i < config->num_allocatable_float_registers(); ++i) { |
+ int code = config->GetAllocatableFloatCode(i); |
+ int dst_offset = code * kFloatSize + float_regs_offset; |
+ int src_offset = code * kFloatSize + kNumberOfRegisters * kPointerSize; |
+ __ lfs(d0, MemOperand(sp, src_offset)); |
+ __ stfs(d0, MemOperand(r4, dst_offset)); |
+ } |
// Remove the bailout id and the saved registers from the stack. |
__ addi(sp, sp, Operand(kSavedRegistersAreaSize + (1 * kPointerSize))); |