Index: src/x87/deoptimizer-x87.cc |
diff --git a/src/ia32/deoptimizer-ia32.cc b/src/x87/deoptimizer-x87.cc |
similarity index 90% |
copy from src/ia32/deoptimizer-ia32.cc |
copy to src/x87/deoptimizer-x87.cc |
index 05b2ce8a74224275f904787080831d4520674b2a..fb0e8f268658f9ded13d52639da0448b35db9a1d 100644 |
--- a/src/ia32/deoptimizer-ia32.cc |
+++ b/src/x87/deoptimizer-x87.cc |
@@ -4,7 +4,7 @@ |
#include "v8.h" |
-#if V8_TARGET_ARCH_IA32 |
+#if V8_TARGET_ARCH_X87 |
#include "codegen.h" |
#include "deoptimizer.h" |
@@ -187,7 +187,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 < DoubleRegister::NumAllocatableRegisters(); i++) { |
input_->SetDoubleRegister(i, 0.0); |
} |
@@ -209,10 +209,8 @@ void Deoptimizer::SetPlatformCompiledStubRegisters( |
void Deoptimizer::CopyDoubleRegisters(FrameDescription* output_frame) { |
- for (int i = 0; i < XMMRegister::kMaxNumAllocatableRegisters; ++i) { |
- double double_value = input_->GetDoubleRegister(i); |
- output_frame->SetDoubleRegister(i, double_value); |
- } |
+ // Do nothing for X87. |
+ return; |
} |
@@ -237,20 +235,9 @@ void Deoptimizer::EntryGenerator::Generate() { |
// Save all general purpose registers before messing with them. |
const int kNumberOfRegisters = Register::kNumRegisters; |
- |
- const int kDoubleRegsSize = kDoubleSize * |
- XMMRegister::kMaxNumAllocatableRegisters; |
- __ sub(esp, Immediate(kDoubleRegsSize)); |
- for (int i = 0; i < XMMRegister::kMaxNumAllocatableRegisters; ++i) { |
- XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i); |
- int offset = i * kDoubleSize; |
- __ movsd(Operand(esp, offset), xmm_reg); |
- } |
- |
__ pushad(); |
- const int kSavedRegistersAreaSize = kNumberOfRegisters * kPointerSize + |
- kDoubleRegsSize; |
+ const int kSavedRegistersAreaSize = kNumberOfRegisters * kPointerSize; |
// Get the bailout id from the stack. |
__ mov(ebx, Operand(esp, kSavedRegistersAreaSize)); |
@@ -288,22 +275,13 @@ void Deoptimizer::EntryGenerator::Generate() { |
__ pop(Operand(ebx, offset)); |
} |
- 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; |
- __ movsd(xmm0, Operand(esp, src_offset)); |
- __ movsd(Operand(ebx, dst_offset), xmm0); |
- } |
- |
// Clear FPU all exceptions. |
// TODO(ulan): Find out why the TOP register is not zero here in some cases, |
// and check that the generated code never deoptimizes with unbalanced stack. |
__ fnclex(); |
// Remove the bailout id, return address and the double registers. |
- __ add(esp, Immediate(kDoubleRegsSize + 2 * kPointerSize)); |
+ __ add(esp, Immediate(2 * kPointerSize)); |
// Compute a pointer to the unwinding limit in register ecx; that is |
// the first stack slot not part of the input frame. |
@@ -372,13 +350,6 @@ void Deoptimizer::EntryGenerator::Generate() { |
__ cmp(eax, edx); |
__ 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; |
- __ movsd(xmm_reg, Operand(ebx, src_offset)); |
- } |
- |
// Push state, pc, and continuation from the last output frame. |
__ push(Operand(ebx, FrameDescription::state_offset())); |
__ push(Operand(ebx, FrameDescription::pc_offset())); |
@@ -434,4 +405,4 @@ void FrameDescription::SetCallerConstantPool(unsigned offset, intptr_t value) { |
} } // namespace v8::internal |
-#endif // V8_TARGET_ARCH_IA32 |
+#endif // V8_TARGET_ARCH_X87 |