| OLD | NEW |
| 1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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/base/bits.h" | 5 #include "src/base/bits.h" |
| 6 #include "src/code-factory.h" | 6 #include "src/code-factory.h" |
| 7 #include "src/code-stubs.h" | 7 #include "src/code-stubs.h" |
| 8 #include "src/hydrogen-osr.h" | 8 #include "src/hydrogen-osr.h" |
| 9 #include "src/ic/ic.h" | 9 #include "src/ic/ic.h" |
| 10 #include "src/ic/stub-cache.h" | 10 #include "src/ic/stub-cache.h" |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 145 __ addi(ip, ip, Operand(prologue_offset)); | 145 __ addi(ip, ip, Operand(prologue_offset)); |
| 146 } | 146 } |
| 147 info()->set_prologue_offset(prologue_offset); | 147 info()->set_prologue_offset(prologue_offset); |
| 148 if (NeedsEagerFrame()) { | 148 if (NeedsEagerFrame()) { |
| 149 if (info()->IsStub()) { | 149 if (info()->IsStub()) { |
| 150 __ StubPrologue(prologue_offset); | 150 __ StubPrologue(prologue_offset); |
| 151 } else { | 151 } else { |
| 152 __ Prologue(info()->IsCodePreAgingActive(), prologue_offset); | 152 __ Prologue(info()->IsCodePreAgingActive(), prologue_offset); |
| 153 } | 153 } |
| 154 frame_is_built_ = true; | 154 frame_is_built_ = true; |
| 155 info_->AddNoFrameRange(0, masm_->pc_offset()); | |
| 156 } | 155 } |
| 157 | 156 |
| 158 // Reserve space for the stack slots needed by the code. | 157 // Reserve space for the stack slots needed by the code. |
| 159 int slots = GetStackSlotCount(); | 158 int slots = GetStackSlotCount(); |
| 160 if (slots > 0) { | 159 if (slots > 0) { |
| 161 __ subi(sp, sp, Operand(slots * kPointerSize)); | 160 __ subi(sp, sp, Operand(slots * kPointerSize)); |
| 162 if (FLAG_debug_code) { | 161 if (FLAG_debug_code) { |
| 163 __ Push(r3, r4); | 162 __ Push(r3, r4); |
| 164 __ li(r0, Operand(slots)); | 163 __ li(r0, Operand(slots)); |
| 165 __ mtctr(r0); | 164 __ mtctr(r0); |
| (...skipping 2672 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2838 // Runtime::TraceExit returns its parameter in r3. We're leaving the code | 2837 // Runtime::TraceExit returns its parameter in r3. We're leaving the code |
| 2839 // managed by the register allocator and tearing down the frame, it's | 2838 // managed by the register allocator and tearing down the frame, it's |
| 2840 // safe to write to the context register. | 2839 // safe to write to the context register. |
| 2841 __ push(r3); | 2840 __ push(r3); |
| 2842 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 2841 __ LoadP(cp, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
| 2843 __ CallRuntime(Runtime::kTraceExit, 1); | 2842 __ CallRuntime(Runtime::kTraceExit, 1); |
| 2844 } | 2843 } |
| 2845 if (info()->saves_caller_doubles()) { | 2844 if (info()->saves_caller_doubles()) { |
| 2846 RestoreCallerDoubles(); | 2845 RestoreCallerDoubles(); |
| 2847 } | 2846 } |
| 2848 int no_frame_start = -1; | |
| 2849 if (instr->has_constant_parameter_count()) { | 2847 if (instr->has_constant_parameter_count()) { |
| 2850 int parameter_count = ToInteger32(instr->constant_parameter_count()); | 2848 int parameter_count = ToInteger32(instr->constant_parameter_count()); |
| 2851 int32_t sp_delta = (parameter_count + 1) * kPointerSize; | 2849 int32_t sp_delta = (parameter_count + 1) * kPointerSize; |
| 2852 if (NeedsEagerFrame()) { | 2850 if (NeedsEagerFrame()) { |
| 2853 no_frame_start = masm_->LeaveFrame(StackFrame::JAVA_SCRIPT, sp_delta); | 2851 masm_->LeaveFrame(StackFrame::JAVA_SCRIPT, sp_delta); |
| 2854 } else if (sp_delta != 0) { | 2852 } else if (sp_delta != 0) { |
| 2855 __ addi(sp, sp, Operand(sp_delta)); | 2853 __ addi(sp, sp, Operand(sp_delta)); |
| 2856 } | 2854 } |
| 2857 } else { | 2855 } else { |
| 2858 DCHECK(info()->IsStub()); // Functions would need to drop one more value. | 2856 DCHECK(info()->IsStub()); // Functions would need to drop one more value. |
| 2859 Register reg = ToRegister(instr->parameter_count()); | 2857 Register reg = ToRegister(instr->parameter_count()); |
| 2860 // The argument count parameter is a smi | 2858 // The argument count parameter is a smi |
| 2861 if (NeedsEagerFrame()) { | 2859 if (NeedsEagerFrame()) { |
| 2862 no_frame_start = masm_->LeaveFrame(StackFrame::JAVA_SCRIPT); | 2860 masm_->LeaveFrame(StackFrame::JAVA_SCRIPT); |
| 2863 } | 2861 } |
| 2864 __ SmiToPtrArrayOffset(r0, reg); | 2862 __ SmiToPtrArrayOffset(r0, reg); |
| 2865 __ add(sp, sp, r0); | 2863 __ add(sp, sp, r0); |
| 2866 } | 2864 } |
| 2867 | 2865 |
| 2868 __ blr(); | 2866 __ blr(); |
| 2869 | |
| 2870 if (no_frame_start != -1) { | |
| 2871 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); | |
| 2872 } | |
| 2873 } | 2867 } |
| 2874 | 2868 |
| 2875 | 2869 |
| 2876 template <class T> | 2870 template <class T> |
| 2877 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { | 2871 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { |
| 2878 Register vector_register = ToRegister(instr->temp_vector()); | 2872 Register vector_register = ToRegister(instr->temp_vector()); |
| 2879 Register slot_register = LoadDescriptor::SlotRegister(); | 2873 Register slot_register = LoadDescriptor::SlotRegister(); |
| 2880 DCHECK(vector_register.is(LoadWithVectorDescriptor::VectorRegister())); | 2874 DCHECK(vector_register.is(LoadWithVectorDescriptor::VectorRegister())); |
| 2881 DCHECK(slot_register.is(r3)); | 2875 DCHECK(slot_register.is(r3)); |
| 2882 | 2876 |
| (...skipping 3246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6129 __ Push(scope_info); | 6123 __ Push(scope_info); |
| 6130 __ push(ToRegister(instr->function())); | 6124 __ push(ToRegister(instr->function())); |
| 6131 CallRuntime(Runtime::kPushBlockContext, 2, instr); | 6125 CallRuntime(Runtime::kPushBlockContext, 2, instr); |
| 6132 RecordSafepoint(Safepoint::kNoLazyDeopt); | 6126 RecordSafepoint(Safepoint::kNoLazyDeopt); |
| 6133 } | 6127 } |
| 6134 | 6128 |
| 6135 | 6129 |
| 6136 #undef __ | 6130 #undef __ |
| 6137 } // namespace internal | 6131 } // namespace internal |
| 6138 } // namespace v8 | 6132 } // namespace v8 |
| OLD | NEW |