Chromium Code Reviews| Index: src/arm/deoptimizer-arm.cc |
| diff --git a/src/arm/deoptimizer-arm.cc b/src/arm/deoptimizer-arm.cc |
| index 19667b9d5f44bf9645bf3d5049d3081a191b795b..f3dd64dc0805cac2d8f846f822847c6a1d6a1bc6 100644 |
| --- a/src/arm/deoptimizer-arm.cc |
| +++ b/src/arm/deoptimizer-arm.cc |
| @@ -461,6 +461,44 @@ void Deoptimizer::DoComputeArgumentsAdaptorFrame(TranslationIterator* iterator, |
| } |
| +void Deoptimizer::DoCompiledStubPseudoFrame(TranslationIterator* iterator, |
|
Jakob Kummerow
2012/11/19 12:36:00
s/Pseudo//
danno
2012/11/26 17:16:18
Done.
|
| + int frame_index) { |
| + // Builtins* builtins = isolate_->builtins(); |
| + // Code::Kind stub_kind = static_cast<Code::Kind>(iterator->Next()); |
|
Jakob Kummerow
2012/11/19 12:36:00
remove
danno
2012/11/26 17:16:18
Done.
|
| + FrameDescription* output_frame = new(0) FrameDescription(0, 0); |
|
Jakob Kummerow
2012/11/19 12:36:00
just "NULL"?
danno
2012/11/26 17:16:18
Done.
|
| + Code* continuation = |
| + isolate_->builtins()->builtin(Builtins::kNotifyICMiss); |
| + output_frame->SetState(Smi::FromInt(FullCodeGenerator::NO_REGISTERS)); |
| + output_frame->SetContinuation( |
| + reinterpret_cast<uintptr_t>(continuation->entry())); |
| + Handle<Code> miss_ic = isolate_->builtins()->KeyedLoadIC_Miss(); |
|
Jakob Kummerow
2012/11/19 12:36:00
use stub_kind (see line 478) to figure this out
danno
2012/11/26 17:16:18
Done.
|
| + output_frame->SetPc( |
| + reinterpret_cast<intptr_t>(miss_ic->instruction_start())); |
| + |
| + Code::Kind stub_kind = static_cast<Code::Kind>(iterator->Next()); |
| + ASSERT(stub_kind == Code::KEYED_LOAD_IC); |
| + USE(stub_kind); |
| + |
| + 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(r1.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(r0.code(), input_value); |
| + |
| + ASSERT(frame_index == 0); |
| + output_[frame_index] = output_frame; |
| +} |
| + |
| + |
| void Deoptimizer::DoComputeConstructStubFrame(TranslationIterator* iterator, |
| int frame_index) { |
| Builtins* builtins = isolate_->builtins(); |
| @@ -888,7 +926,7 @@ void Deoptimizer::FillInputFrame(Address tos, JavaScriptFrame* frame) { |
| } |
| input_->SetRegister(sp.code(), reinterpret_cast<intptr_t>(frame->sp())); |
| input_->SetRegister(fp.code(), reinterpret_cast<intptr_t>(frame->fp())); |
| - for (int i = 0; i < DoubleRegister::kNumAllocatableRegisters; i++) { |
| + for (int i = 0; i < DoubleRegister::NumAllocatableRegisters(); i++) { |
| input_->SetDoubleRegister(i, 0.0); |
| } |
| @@ -908,7 +946,6 @@ void Deoptimizer::EntryGenerator::Generate() { |
| Isolate* isolate = masm()->isolate(); |
| - CpuFeatures::Scope scope(VFP3); |
| // Save all general purpose registers before messing with them. |
| const int kNumberOfRegisters = Register::kNumRegisters; |
| @@ -916,23 +953,27 @@ void Deoptimizer::EntryGenerator::Generate() { |
| RegList restored_regs = kJSCallerSaved | kCalleeSaved | ip.bit(); |
| const int kDoubleRegsSize = |
| - kDoubleSize * DwVfpRegister::kNumAllocatableRegisters; |
| - |
| - // Save all VFP registers before messing with them. |
| - DwVfpRegister first = DwVfpRegister::FromAllocationIndex(0); |
| - DwVfpRegister last = |
| - DwVfpRegister::FromAllocationIndex( |
| - DwVfpRegister::kNumAllocatableRegisters - 1); |
| - ASSERT(last.code() > first.code()); |
| - ASSERT((last.code() - first.code()) == |
| - (DwVfpRegister::kNumAllocatableRegisters - 1)); |
| + kDoubleSize * DwVfpRegister::NumAllocatableRegisters(); |
| + |
| + if (CpuFeatures::IsSupported(VFP2)) { |
| + // Save all VFP registers before messing with them. |
| + DwVfpRegister first = DwVfpRegister::FromAllocationIndex(0); |
| + DwVfpRegister last = |
| + DwVfpRegister::FromAllocationIndex( |
| + DwVfpRegister::NumAllocatableRegisters() - 1); |
| + ASSERT(last.code() > first.code()); |
| + ASSERT((last.code() - first.code()) == |
| + (DwVfpRegister::NumAllocatableRegisters() - 1)); |
| #ifdef DEBUG |
| - for (int i = 0; i <= (DwVfpRegister::kNumAllocatableRegisters - 1); i++) { |
| - ASSERT((DwVfpRegister::FromAllocationIndex(i).code() <= last.code()) && |
| - (DwVfpRegister::FromAllocationIndex(i).code() >= first.code())); |
| - } |
| + for (int i = 0; i <= (DwVfpRegister::NumAllocatableRegisters() - 1); i++) { |
| + ASSERT((DwVfpRegister::FromAllocationIndex(i).code() <= last.code()) && |
| + (DwVfpRegister::FromAllocationIndex(i).code() >= first.code())); |
| + } |
| #endif |
| - __ vstm(db_w, sp, first, last); |
| + __ vstm(db_w, sp, first, last); |
| + } else { |
| + __ sub(sp, sp, Operand(kDoubleRegsSize)); |
| + } |
| // Push all 16 registers (needed to populate FrameDescription::registers_). |
| // TODO(1588) Note that using pc with stm is deprecated, so we should perhaps |
| @@ -991,14 +1032,16 @@ void Deoptimizer::EntryGenerator::Generate() { |
| __ str(r2, MemOperand(r1, offset)); |
| } |
| - // Copy VFP registers to |
| - // double_registers_[DoubleRegister::kNumAllocatableRegisters] |
| - int double_regs_offset = FrameDescription::double_registers_offset(); |
| - for (int i = 0; i < DwVfpRegister::kNumAllocatableRegisters; ++i) { |
| - int dst_offset = i * kDoubleSize + double_regs_offset; |
| - int src_offset = i * kDoubleSize + kNumberOfRegisters * kPointerSize; |
| - __ vldr(d0, sp, src_offset); |
| - __ vstr(d0, r1, dst_offset); |
| + if (CpuFeatures::IsSupported(VFP2)) { |
| + // Copy VFP registers to |
| + // double_registers_[DoubleRegister::kMaxNumAllocatableRegisters] |
| + int double_regs_offset = FrameDescription::double_registers_offset(); |
| + for (int i = 0; i < DwVfpRegister::NumAllocatableRegisters(); ++i) { |
| + int dst_offset = i * kDoubleSize + double_regs_offset; |
| + int src_offset = i * kDoubleSize + kNumberOfRegisters * kPointerSize; |
| + __ vldr(d0, sp, src_offset); |
| + __ vstr(d0, r1, dst_offset); |
| + } |
| } |
| // Remove the bailout id, eventually return address, and the saved registers |
| @@ -1019,10 +1062,13 @@ void Deoptimizer::EntryGenerator::Generate() { |
| // frame description. |
| __ add(r3, r1, Operand(FrameDescription::frame_content_offset())); |
| Label pop_loop; |
| + Label pop_loop_header; |
| + __ b(&pop_loop_header); |
| __ bind(&pop_loop); |
| __ pop(r4); |
| __ str(r4, MemOperand(r3, 0)); |
| __ add(r3, r3, Operand(sizeof(uint32_t))); |
| + __ bind(&pop_loop_header); |
| __ cmp(r2, sp); |
| __ b(ne, &pop_loop); |
| @@ -1039,24 +1085,29 @@ void Deoptimizer::EntryGenerator::Generate() { |
| __ pop(r0); // Restore deoptimizer object (class Deoptimizer). |
| // Replace the current (input) frame with the output frames. |
| - Label outer_push_loop, inner_push_loop; |
| + Label outer_push_loop, inner_push_loop, |
| + outer_loop_header, inner_loop_header; |
| // Outer loop state: r0 = current "FrameDescription** output_", |
| // r1 = one past the last FrameDescription**. |
| __ ldr(r1, MemOperand(r0, Deoptimizer::output_count_offset())); |
| __ ldr(r0, MemOperand(r0, Deoptimizer::output_offset())); // r0 is output_. |
| __ add(r1, r0, Operand(r1, LSL, 2)); |
| + __ jmp(&outer_loop_header); |
| __ bind(&outer_push_loop); |
| // Inner loop state: r2 = current FrameDescription*, r3 = loop index. |
| __ ldr(r2, MemOperand(r0, 0)); // output_[ix] |
| __ ldr(r3, MemOperand(r2, FrameDescription::frame_size_offset())); |
| + __ jmp(&inner_loop_header); |
| __ bind(&inner_push_loop); |
| __ sub(r3, r3, Operand(sizeof(uint32_t))); |
| __ add(r6, r2, Operand(r3)); |
| __ ldr(r7, MemOperand(r6, FrameDescription::frame_content_offset())); |
| __ push(r7); |
| + __ bind(&inner_loop_header); |
| __ cmp(r3, Operand(0)); |
| __ b(ne, &inner_push_loop); // test for gt? |
| __ add(r0, r0, Operand(kPointerSize)); |
| + __ bind(&outer_loop_header); |
| __ cmp(r0, r1); |
| __ b(lt, &outer_push_loop); |