OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/arm/lithium-codegen-arm.h" | 5 #include "src/arm/lithium-codegen-arm.h" |
6 #include "src/arm/lithium-gap-resolver-arm.h" | 6 #include "src/arm/lithium-gap-resolver-arm.h" |
7 #include "src/base/bits.h" | 7 #include "src/base/bits.h" |
8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
10 #include "src/hydrogen-osr.h" | 10 #include "src/hydrogen-osr.h" |
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 } | 135 } |
136 | 136 |
137 info()->set_prologue_offset(masm_->pc_offset()); | 137 info()->set_prologue_offset(masm_->pc_offset()); |
138 if (NeedsEagerFrame()) { | 138 if (NeedsEagerFrame()) { |
139 if (info()->IsStub()) { | 139 if (info()->IsStub()) { |
140 __ StubPrologue(); | 140 __ StubPrologue(); |
141 } else { | 141 } else { |
142 __ Prologue(info()->IsCodePreAgingActive()); | 142 __ Prologue(info()->IsCodePreAgingActive()); |
143 } | 143 } |
144 frame_is_built_ = true; | 144 frame_is_built_ = true; |
145 info_->AddNoFrameRange(0, masm_->pc_offset()); | |
146 } | 145 } |
147 | 146 |
148 // Reserve space for the stack slots needed by the code. | 147 // Reserve space for the stack slots needed by the code. |
149 int slots = GetStackSlotCount(); | 148 int slots = GetStackSlotCount(); |
150 if (slots > 0) { | 149 if (slots > 0) { |
151 if (FLAG_debug_code) { | 150 if (FLAG_debug_code) { |
152 __ sub(sp, sp, Operand(slots * kPointerSize)); | 151 __ sub(sp, sp, Operand(slots * kPointerSize)); |
153 __ push(r0); | 152 __ push(r0); |
154 __ push(r1); | 153 __ push(r1); |
155 __ add(r0, sp, Operand(slots * kPointerSize)); | 154 __ add(r0, sp, Operand(slots * kPointerSize)); |
(...skipping 2596 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2752 // Runtime::TraceExit returns its parameter in r0. We're leaving the code | 2751 // Runtime::TraceExit returns its parameter in r0. We're leaving the code |
2753 // managed by the register allocator and tearing down the frame, it's | 2752 // managed by the register allocator and tearing down the frame, it's |
2754 // safe to write to the context register. | 2753 // safe to write to the context register. |
2755 __ push(r0); | 2754 __ push(r0); |
2756 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2755 __ ldr(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
2757 __ CallRuntime(Runtime::kTraceExit, 1); | 2756 __ CallRuntime(Runtime::kTraceExit, 1); |
2758 } | 2757 } |
2759 if (info()->saves_caller_doubles()) { | 2758 if (info()->saves_caller_doubles()) { |
2760 RestoreCallerDoubles(); | 2759 RestoreCallerDoubles(); |
2761 } | 2760 } |
2762 int no_frame_start = -1; | |
2763 if (NeedsEagerFrame()) { | 2761 if (NeedsEagerFrame()) { |
2764 no_frame_start = masm_->LeaveFrame(StackFrame::JAVA_SCRIPT); | 2762 masm_->LeaveFrame(StackFrame::JAVA_SCRIPT); |
2765 } | 2763 } |
2766 { ConstantPoolUnavailableScope constant_pool_unavailable(masm()); | 2764 { ConstantPoolUnavailableScope constant_pool_unavailable(masm()); |
2767 if (instr->has_constant_parameter_count()) { | 2765 if (instr->has_constant_parameter_count()) { |
2768 int parameter_count = ToInteger32(instr->constant_parameter_count()); | 2766 int parameter_count = ToInteger32(instr->constant_parameter_count()); |
2769 int32_t sp_delta = (parameter_count + 1) * kPointerSize; | 2767 int32_t sp_delta = (parameter_count + 1) * kPointerSize; |
2770 if (sp_delta != 0) { | 2768 if (sp_delta != 0) { |
2771 __ add(sp, sp, Operand(sp_delta)); | 2769 __ add(sp, sp, Operand(sp_delta)); |
2772 } | 2770 } |
2773 } else { | 2771 } else { |
2774 DCHECK(info()->IsStub()); // Functions would need to drop one more value. | 2772 DCHECK(info()->IsStub()); // Functions would need to drop one more value. |
2775 Register reg = ToRegister(instr->parameter_count()); | 2773 Register reg = ToRegister(instr->parameter_count()); |
2776 // The argument count parameter is a smi | 2774 // The argument count parameter is a smi |
2777 __ SmiUntag(reg); | 2775 __ SmiUntag(reg); |
2778 __ add(sp, sp, Operand(reg, LSL, kPointerSizeLog2)); | 2776 __ add(sp, sp, Operand(reg, LSL, kPointerSizeLog2)); |
2779 } | 2777 } |
2780 | 2778 |
2781 __ Jump(lr); | 2779 __ Jump(lr); |
2782 | |
2783 if (no_frame_start != -1) { | |
2784 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); | |
2785 } | |
2786 } | 2780 } |
2787 } | 2781 } |
2788 | 2782 |
2789 | 2783 |
2790 template <class T> | 2784 template <class T> |
2791 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { | 2785 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { |
2792 Register vector_register = ToRegister(instr->temp_vector()); | 2786 Register vector_register = ToRegister(instr->temp_vector()); |
2793 Register slot_register = LoadDescriptor::SlotRegister(); | 2787 Register slot_register = LoadDescriptor::SlotRegister(); |
2794 DCHECK(vector_register.is(LoadWithVectorDescriptor::VectorRegister())); | 2788 DCHECK(vector_register.is(LoadWithVectorDescriptor::VectorRegister())); |
2795 DCHECK(slot_register.is(r0)); | 2789 DCHECK(slot_register.is(r0)); |
(...skipping 3046 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5842 __ push(ToRegister(instr->function())); | 5836 __ push(ToRegister(instr->function())); |
5843 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 5837 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
5844 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5838 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5845 } | 5839 } |
5846 | 5840 |
5847 | 5841 |
5848 #undef __ | 5842 #undef __ |
5849 | 5843 |
5850 } // namespace internal | 5844 } // namespace internal |
5851 } // namespace v8 | 5845 } // namespace v8 |
OLD | NEW |