Index: src/x87/deoptimizer-x87.cc |
diff --git a/src/x87/deoptimizer-x87.cc b/src/x87/deoptimizer-x87.cc |
index 3a5d2640be89a1498af16a0f1e174fdda1106c56..6352cf80451ec287bd79e2c309db1618ad06beab 100644 |
--- a/src/x87/deoptimizer-x87.cc |
+++ b/src/x87/deoptimizer-x87.cc |
@@ -7,6 +7,7 @@ |
#include "src/codegen.h" |
#include "src/deoptimizer.h" |
#include "src/full-codegen/full-codegen.h" |
+#include "src/register-configuration.h" |
#include "src/safepoint-table.h" |
#include "src/x87/frames-x87.h" |
@@ -181,7 +182,7 @@ void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) { |
} |
input_->SetRegister(esp.code(), reinterpret_cast<intptr_t>(frame->sp())); |
input_->SetRegister(ebp.code(), reinterpret_cast<intptr_t>(frame->fp())); |
- for (int i = 0; i < DoubleRegister::NumAllocatableRegisters(); i++) { |
+ for (int i = 0; i < X87Register::kMaxNumRegisters; i++) { |
input_->SetDoubleRegister(i, 0.0); |
} |
@@ -203,7 +204,7 @@ void Deoptimizer::SetPlatformCompiledStubRegisters( |
void Deoptimizer::CopyDoubleRegisters(FrameDescription* output_frame) { |
- for (int i = 0; i < X87Register::kMaxNumAllocatableRegisters; ++i) { |
+ for (int i = 0; i < X87Register::kMaxNumRegisters; ++i) { |
double double_value = input_->GetDoubleRegister(i); |
output_frame->SetDoubleRegister(i, double_value); |
} |
@@ -233,8 +234,7 @@ void Deoptimizer::TableEntryGenerator::Generate() { |
// Save all general purpose registers before messing with them. |
const int kNumberOfRegisters = Register::kNumRegisters; |
- const int kDoubleRegsSize = |
- kDoubleSize * X87Register::kMaxNumAllocatableRegisters; |
+ const int kDoubleRegsSize = kDoubleSize * X87Register::kMaxNumRegisters; |
// Reserve space for x87 fp registers. |
__ sub(esp, Immediate(kDoubleRegsSize)); |
@@ -312,10 +312,13 @@ void Deoptimizer::TableEntryGenerator::Generate() { |
} |
int double_regs_offset = FrameDescription::double_registers_offset(); |
+ const RegisterConfiguration* config = |
+ RegisterConfiguration::ArchDefault(RegisterConfiguration::CRANKSHAFT); |
// Fill in the double input registers. |
for (int i = 0; i < X87Register::kMaxNumAllocatableRegisters; ++i) { |
- int dst_offset = i * kDoubleSize + double_regs_offset; |
- int src_offset = i * kDoubleSize; |
+ int code = config->GetAllocatableDoubleCode(i); |
+ int dst_offset = code * kDoubleSize + double_regs_offset; |
+ int src_offset = code * kDoubleSize; |
__ fld_d(Operand(esp, src_offset)); |
__ fstp_d(Operand(ebx, dst_offset)); |
} |