OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
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 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 | 146 |
147 info()->set_prologue_offset(masm_->pc_offset()); | 147 info()->set_prologue_offset(masm_->pc_offset()); |
148 if (NeedsEagerFrame()) { | 148 if (NeedsEagerFrame()) { |
149 DCHECK(!frame_is_built_); | 149 DCHECK(!frame_is_built_); |
150 frame_is_built_ = true; | 150 frame_is_built_ = true; |
151 if (info()->IsStub()) { | 151 if (info()->IsStub()) { |
152 __ StubPrologue(); | 152 __ StubPrologue(); |
153 } else { | 153 } else { |
154 __ Prologue(info()->IsCodePreAgingActive()); | 154 __ Prologue(info()->IsCodePreAgingActive()); |
155 } | 155 } |
156 info()->AddNoFrameRange(0, masm_->pc_offset()); | |
157 } | 156 } |
158 | 157 |
159 // Reserve space for the stack slots needed by the code. | 158 // Reserve space for the stack slots needed by the code. |
160 int slots = GetStackSlotCount(); | 159 int slots = GetStackSlotCount(); |
161 if (slots > 0) { | 160 if (slots > 0) { |
162 if (FLAG_debug_code) { | 161 if (FLAG_debug_code) { |
163 __ subp(rsp, Immediate(slots * kPointerSize)); | 162 __ subp(rsp, Immediate(slots * kPointerSize)); |
164 #ifdef _MSC_VER | 163 #ifdef _MSC_VER |
165 MakeSureStackPagesMapped(slots * kPointerSize); | 164 MakeSureStackPagesMapped(slots * kPointerSize); |
166 #endif | 165 #endif |
(...skipping 2538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2705 // to return the value in the same register. We're leaving the code | 2704 // to return the value in the same register. We're leaving the code |
2706 // managed by the register allocator and tearing down the frame, it's | 2705 // managed by the register allocator and tearing down the frame, it's |
2707 // safe to write to the context register. | 2706 // safe to write to the context register. |
2708 __ Push(rax); | 2707 __ Push(rax); |
2709 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); | 2708 __ movp(rsi, Operand(rbp, StandardFrameConstants::kContextOffset)); |
2710 __ CallRuntime(Runtime::kTraceExit, 1); | 2709 __ CallRuntime(Runtime::kTraceExit, 1); |
2711 } | 2710 } |
2712 if (info()->saves_caller_doubles()) { | 2711 if (info()->saves_caller_doubles()) { |
2713 RestoreCallerDoubles(); | 2712 RestoreCallerDoubles(); |
2714 } | 2713 } |
2715 int no_frame_start = -1; | |
2716 if (NeedsEagerFrame()) { | 2714 if (NeedsEagerFrame()) { |
2717 __ movp(rsp, rbp); | 2715 __ movp(rsp, rbp); |
2718 __ popq(rbp); | 2716 __ popq(rbp); |
2719 no_frame_start = masm_->pc_offset(); | |
2720 } | 2717 } |
2721 if (instr->has_constant_parameter_count()) { | 2718 if (instr->has_constant_parameter_count()) { |
2722 __ Ret((ToInteger32(instr->constant_parameter_count()) + 1) * kPointerSize, | 2719 __ Ret((ToInteger32(instr->constant_parameter_count()) + 1) * kPointerSize, |
2723 rcx); | 2720 rcx); |
2724 } else { | 2721 } else { |
2725 DCHECK(info()->IsStub()); // Functions would need to drop one more value. | 2722 DCHECK(info()->IsStub()); // Functions would need to drop one more value. |
2726 Register reg = ToRegister(instr->parameter_count()); | 2723 Register reg = ToRegister(instr->parameter_count()); |
2727 // The argument count parameter is a smi | 2724 // The argument count parameter is a smi |
2728 __ SmiToInteger32(reg, reg); | 2725 __ SmiToInteger32(reg, reg); |
2729 Register return_addr_reg = reg.is(rcx) ? rbx : rcx; | 2726 Register return_addr_reg = reg.is(rcx) ? rbx : rcx; |
2730 __ PopReturnAddressTo(return_addr_reg); | 2727 __ PopReturnAddressTo(return_addr_reg); |
2731 __ shlp(reg, Immediate(kPointerSizeLog2)); | 2728 __ shlp(reg, Immediate(kPointerSizeLog2)); |
2732 __ addp(rsp, reg); | 2729 __ addp(rsp, reg); |
2733 __ jmp(return_addr_reg); | 2730 __ jmp(return_addr_reg); |
2734 } | 2731 } |
2735 if (no_frame_start != -1) { | |
2736 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); | |
2737 } | |
2738 } | 2732 } |
2739 | 2733 |
2740 | 2734 |
2741 template <class T> | 2735 template <class T> |
2742 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { | 2736 void LCodeGen::EmitVectorLoadICRegisters(T* instr) { |
2743 Register vector_register = ToRegister(instr->temp_vector()); | 2737 Register vector_register = ToRegister(instr->temp_vector()); |
2744 Register slot_register = LoadWithVectorDescriptor::SlotRegister(); | 2738 Register slot_register = LoadWithVectorDescriptor::SlotRegister(); |
2745 DCHECK(vector_register.is(LoadWithVectorDescriptor::VectorRegister())); | 2739 DCHECK(vector_register.is(LoadWithVectorDescriptor::VectorRegister())); |
2746 DCHECK(slot_register.is(rax)); | 2740 DCHECK(slot_register.is(rax)); |
2747 | 2741 |
(...skipping 3166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5914 RecordSafepoint(Safepoint::kNoLazyDeopt); | 5908 RecordSafepoint(Safepoint::kNoLazyDeopt); |
5915 } | 5909 } |
5916 | 5910 |
5917 | 5911 |
5918 #undef __ | 5912 #undef __ |
5919 | 5913 |
5920 } // namespace internal | 5914 } // namespace internal |
5921 } // namespace v8 | 5915 } // namespace v8 |
5922 | 5916 |
5923 #endif // V8_TARGET_ARCH_X64 | 5917 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |