Index: src/ia32/deoptimizer-ia32.cc |
diff --git a/src/ia32/deoptimizer-ia32.cc b/src/ia32/deoptimizer-ia32.cc |
index 8fd7316355135d893caafb8c26beba576ea35b9d..c9ecaccd2daf318ffd3fbcaafca193a0e2965c6c 100644 |
--- a/src/ia32/deoptimizer-ia32.cc |
+++ b/src/ia32/deoptimizer-ia32.cc |
@@ -295,7 +295,7 @@ static int LookupBailoutId(DeoptimizationInputData* data, BailoutId ast_id) { |
void Deoptimizer::DoComputeOsrOutputFrame() { |
DeoptimizationInputData* data = DeoptimizationInputData::cast( |
- compiled_code_->deoptimization_data()); |
+ optimized_code_->deoptimization_data()); |
unsigned ast_id = data->OsrAstId()->value(); |
// TODO(kasperl): This should not be the bailout_id_. It should be |
// the ast id. Confusing. |
@@ -332,7 +332,7 @@ void Deoptimizer::DoComputeOsrOutputFrame() { |
unsigned input_frame_size = input_->GetFrameSize(); |
ASSERT(fixed_size + height_in_bytes == input_frame_size); |
- unsigned stack_slot_size = compiled_code_->stack_slots() * kPointerSize; |
+ unsigned stack_slot_size = optimized_code_->stack_slots() * kPointerSize; |
unsigned outgoing_height = data->ArgumentsStackHeight(bailout_id)->value(); |
unsigned outgoing_size = outgoing_height * kPointerSize; |
unsigned output_frame_size = fixed_size + stack_slot_size + outgoing_size; |
@@ -443,7 +443,7 @@ void Deoptimizer::DoComputeOsrOutputFrame() { |
unsigned pc_offset = data->OsrPcOffset()->value(); |
uint32_t pc = reinterpret_cast<uint32_t>( |
- compiled_code_->entry() + pc_offset); |
+ optimized_code_->entry() + pc_offset); |
output_[0]->SetPc(pc); |
} |
Code* continuation = |
@@ -557,70 +557,6 @@ void Deoptimizer::DoComputeArgumentsAdaptorFrame(TranslationIterator* iterator, |
} |
-void Deoptimizer::DoCompiledStubFrame(TranslationIterator* iterator, |
- int frame_index) { |
- // |
- // FROM TO <-ebp |
- // | .... | | .... | |
- // +-------------------------+ +-------------------------+ |
- // | JSFunction continuation | | JSFunction continuation | |
- // +-------------------------+ +-------------------------+<-esp |
- // | | saved frame (ebp) | |
- // | +=========================+<-ebp |
- // | | JSFunction context | |
- // v +-------------------------+ |
- // | COMPILED_STUB marker | ebp = saved frame |
- // +-------------------------+ esi = JSFunction context |
- // | | |
- // | ... | |
- // | | |
- // +-------------------------+<-esp |
- // |
- // |
- int output_frame_size = 1 * kPointerSize; |
- FrameDescription* output_frame = |
- new(output_frame_size) FrameDescription(output_frame_size, 0); |
- Code* notify_miss = |
- isolate_->builtins()->builtin(Builtins::kNotifyICMiss); |
- output_frame->SetState(Smi::FromInt(FullCodeGenerator::NO_REGISTERS)); |
- output_frame->SetContinuation( |
- reinterpret_cast<uint32_t>(notify_miss->entry())); |
- |
- ASSERT(compiled_code_->kind() == Code::COMPILED_STUB); |
- int major_key = compiled_code_->major_key(); |
- CodeStubInterfaceDescriptor* descriptor = |
- isolate_->code_stub_interface_descriptor(major_key); |
- Handle<Code> miss_ic(descriptor->deoptimization_handler_); |
- output_frame->SetPc(reinterpret_cast<intptr_t>(miss_ic->instruction_start())); |
- unsigned input_frame_size = input_->GetFrameSize(); |
- intptr_t value = input_->GetFrameSlot(input_frame_size - kPointerSize); |
- output_frame->SetFrameSlot(0, value); |
- value = input_->GetFrameSlot(input_frame_size - 2 * kPointerSize); |
- output_frame->SetRegister(ebp.code(), value); |
- output_frame->SetFp(value); |
- value = input_->GetFrameSlot(input_frame_size - 3 * kPointerSize); |
- output_frame->SetRegister(esi.code(), value); |
- |
- Translation::Opcode opcode = |
- static_cast<Translation::Opcode>(iterator->Next()); |
- ASSERT(opcode == Translation::REGISTER); |
- USE(opcode); |
- int input_reg = iterator->Next(); |
- intptr_t input_value = input_->GetRegister(input_reg); |
- output_frame->SetRegister(edx.code(), input_value); |
- |
- int32_t next = iterator->Next(); |
- opcode = static_cast<Translation::Opcode>(next); |
- ASSERT(opcode == Translation::REGISTER); |
- input_reg = iterator->Next(); |
- input_value = input_->GetRegister(input_reg); |
- output_frame->SetRegister(ecx.code(), input_value); |
- |
- ASSERT(frame_index == 0); |
- output_[frame_index] = output_frame; |
-} |
- |
- |
void Deoptimizer::DoComputeConstructStubFrame(TranslationIterator* iterator, |
int frame_index) { |
Builtins* builtins = isolate_->builtins(); |
@@ -1049,7 +985,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 < DoubleRegister::kNumAllocatableRegisters; i++) { |
input_->SetDoubleRegister(i, 0.0); |
} |
@@ -1064,6 +1000,7 @@ void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) { |
void Deoptimizer::EntryGenerator::Generate() { |
GeneratePrologue(); |
+ CpuFeatures::Scope scope(SSE2); |
Isolate* isolate = masm()->isolate(); |
@@ -1073,13 +1010,10 @@ void Deoptimizer::EntryGenerator::Generate() { |
const int kDoubleRegsSize = kDoubleSize * |
XMMRegister::kNumAllocatableRegisters; |
__ sub(esp, Immediate(kDoubleRegsSize)); |
- if (CpuFeatures::IsSupported(SSE2)) { |
- CpuFeatures::Scope scope(SSE2); |
- for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) { |
- XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i); |
- int offset = i * kDoubleSize; |
- __ movdbl(Operand(esp, offset), xmm_reg); |
- } |
+ for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) { |
+ XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i); |
+ int offset = i * kDoubleSize; |
+ __ movdbl(Operand(esp, offset), xmm_reg); |
} |
__ pushad(); |
@@ -1127,18 +1061,14 @@ void Deoptimizer::EntryGenerator::Generate() { |
__ pop(Operand(ebx, offset)); |
} |
+ // Fill in the double input registers. |
int double_regs_offset = FrameDescription::double_registers_offset(); |
- if (CpuFeatures::IsSupported(SSE2)) { |
- CpuFeatures::Scope scope(SSE2); |
- // Fill in the double input registers. |
- for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) { |
- int dst_offset = i * kDoubleSize + double_regs_offset; |
- int src_offset = i * kDoubleSize; |
- __ movdbl(xmm0, Operand(esp, src_offset)); |
- __ movdbl(Operand(ebx, dst_offset), xmm0); |
- } |
+ for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) { |
+ int dst_offset = i * kDoubleSize + double_regs_offset; |
+ int src_offset = i * kDoubleSize; |
+ __ movdbl(xmm0, Operand(esp, src_offset)); |
+ __ movdbl(Operand(ebx, dst_offset), xmm0); |
} |
- __ fninit(); |
// Remove the bailout id and the double registers from the stack. |
if (type() == EAGER) { |
@@ -1156,13 +1086,10 @@ void Deoptimizer::EntryGenerator::Generate() { |
// limit and copy the contents of the activation frame to the input |
// frame description. |
__ lea(edx, Operand(ebx, FrameDescription::frame_content_offset())); |
- Label pop_loop_header; |
- __ jmp(&pop_loop_header); |
Label pop_loop; |
__ bind(&pop_loop); |
__ pop(Operand(edx, 0)); |
__ add(edx, Immediate(sizeof(uint32_t))); |
- __ bind(&pop_loop_header); |
__ cmp(ecx, esp); |
__ j(not_equal, &pop_loop); |
@@ -1200,39 +1127,31 @@ void Deoptimizer::EntryGenerator::Generate() { |
} |
// Replace the current frame with the output frames. |
- Label outer_push_loop, inner_push_loop, |
- outer_loop_header, inner_loop_header; |
+ Label outer_push_loop, inner_push_loop; |
// Outer loop state: eax = current FrameDescription**, edx = one past the |
// last FrameDescription**. |
__ mov(edx, Operand(eax, Deoptimizer::output_count_offset())); |
__ mov(eax, Operand(eax, Deoptimizer::output_offset())); |
__ lea(edx, Operand(eax, edx, times_4, 0)); |
- __ jmp(&outer_loop_header); |
__ bind(&outer_push_loop); |
// Inner loop state: ebx = current FrameDescription*, ecx = loop index. |
__ mov(ebx, Operand(eax, 0)); |
__ mov(ecx, Operand(ebx, FrameDescription::frame_size_offset())); |
- __ jmp(&inner_loop_header); |
__ bind(&inner_push_loop); |
__ sub(ecx, Immediate(sizeof(uint32_t))); |
__ push(Operand(ebx, ecx, times_1, FrameDescription::frame_content_offset())); |
- __ bind(&inner_loop_header); |
__ test(ecx, ecx); |
__ j(not_zero, &inner_push_loop); |
__ add(eax, Immediate(kPointerSize)); |
- __ bind(&outer_loop_header); |
__ cmp(eax, edx); |
__ j(below, &outer_push_loop); |
// In case of OSR, we have to restore the XMM registers. |
if (type() == OSR) { |
- if (CpuFeatures::IsSupported(SSE2)) { |
- CpuFeatures::Scope scope(SSE2); |
- for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) { |
- XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i); |
- int src_offset = i * kDoubleSize + double_regs_offset; |
- __ movdbl(xmm_reg, Operand(ebx, src_offset)); |
- } |
+ for (int i = 0; i < XMMRegister::kNumAllocatableRegisters; ++i) { |
+ XMMRegister xmm_reg = XMMRegister::FromAllocationIndex(i); |
+ int src_offset = i * kDoubleSize + double_regs_offset; |
+ __ movdbl(xmm_reg, Operand(ebx, src_offset)); |
} |
} |