Index: src/ia32/deoptimizer-ia32.cc |
diff --git a/src/ia32/deoptimizer-ia32.cc b/src/ia32/deoptimizer-ia32.cc |
index d804f630ea8e5fa6f5744d1e6b78fe334b9a3efb..756922a1cedf2fb1a8475ab4aca0e3746db7dc50 100644 |
--- a/src/ia32/deoptimizer-ia32.cc |
+++ b/src/ia32/deoptimizer-ia32.cc |
@@ -8,6 +8,7 @@ |
#include "src/deoptimizer.h" |
#include "src/full-codegen/full-codegen.h" |
#include "src/ia32/frames-ia32.h" |
+#include "src/register-configuration.h" |
#include "src/safepoint-table.h" |
namespace v8 { |
@@ -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 < XMMRegister::kMaxNumAllocatableRegisters; i++) { |
+ for (int i = 0; i < XMMRegister::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 < XMMRegister::kMaxNumAllocatableRegisters; ++i) { |
+ for (int i = 0; i < XMMRegister::kMaxNumRegisters; ++i) { |
double double_value = input_->GetDoubleRegister(i); |
output_frame->SetDoubleRegister(i, double_value); |
} |
@@ -233,12 +234,13 @@ void Deoptimizer::TableEntryGenerator::Generate() { |
// Save all general purpose registers before messing with them. |
const int kNumberOfRegisters = Register::kNumRegisters; |
- const int kDoubleRegsSize = kDoubleSize * |
- XMMRegister::kMaxNumAllocatableRegisters; |
+ const int kDoubleRegsSize = kDoubleSize * XMMRegister::kMaxNumRegisters; |
__ sub(esp, Immediate(kDoubleRegsSize)); |
- for (int i = 0; i < XMMRegister::kMaxNumAllocatableRegisters; ++i) { |
- XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i); |
- int offset = i * kDoubleSize; |
+ const RegisterConfiguration* config = RegisterConfiguration::ArchDefault(); |
+ for (int i = 0; i < config->num_allocatable_double_registers(); ++i) { |
+ int code = config->GetAllocatableDoubleCode(i); |
+ XMMRegister xmm_reg = XMMRegister::from_code(code); |
+ int offset = code * kDoubleSize; |
__ movsd(Operand(esp, offset), xmm_reg); |
} |
@@ -288,9 +290,10 @@ void Deoptimizer::TableEntryGenerator::Generate() { |
int double_regs_offset = FrameDescription::double_registers_offset(); |
// Fill in the double input registers. |
- for (int i = 0; i < XMMRegister::kMaxNumAllocatableRegisters; ++i) { |
- int dst_offset = i * kDoubleSize + double_regs_offset; |
- int src_offset = i * kDoubleSize; |
+ 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; |
__ movsd(xmm0, Operand(esp, src_offset)); |
__ movsd(Operand(ebx, dst_offset), xmm0); |
} |
@@ -371,9 +374,10 @@ void Deoptimizer::TableEntryGenerator::Generate() { |
__ j(below, &outer_push_loop); |
// In case of a failed STUB, we have to restore the XMM registers. |
- for (int i = 0; i < XMMRegister::kMaxNumAllocatableRegisters; ++i) { |
- XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i); |
- int src_offset = i * kDoubleSize + double_regs_offset; |
+ for (int i = 0; i < config->num_allocatable_double_registers(); ++i) { |
+ int code = config->GetAllocatableDoubleCode(i); |
+ XMMRegister xmm_reg = XMMRegister::from_code(code); |
+ int src_offset = code * kDoubleSize + double_regs_offset; |
__ movsd(xmm_reg, Operand(ebx, src_offset)); |
} |