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 #if V8_TARGET_ARCH_X64 | 5 #if V8_TARGET_ARCH_X64 |
6 | 6 |
7 #include "src/code-factory.h" | 7 #include "src/code-factory.h" |
8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
10 #include "src/compiler.h" | |
11 #include "src/debug/debug.h" | 10 #include "src/debug/debug.h" |
12 #include "src/full-codegen/full-codegen.h" | 11 #include "src/full-codegen/full-codegen.h" |
13 #include "src/ic/ic.h" | 12 #include "src/ic/ic.h" |
14 #include "src/parser.h" | 13 #include "src/parser.h" |
15 #include "src/scopes.h" | 14 #include "src/scopes.h" |
16 | 15 |
17 namespace v8 { | 16 namespace v8 { |
18 namespace internal { | 17 namespace internal { |
19 | 18 |
20 #define __ ACCESS_MASM(masm_) | 19 #define __ ACCESS_MASM(masm_) |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 __ bind(&ok); | 124 __ bind(&ok); |
126 } | 125 } |
127 | 126 |
128 // Open a frame scope to indicate that there is a frame on the stack. The | 127 // Open a frame scope to indicate that there is a frame on the stack. The |
129 // MANUAL indicates that the scope shouldn't actually generate code to set up | 128 // MANUAL indicates that the scope shouldn't actually generate code to set up |
130 // the frame (that is done below). | 129 // the frame (that is done below). |
131 FrameScope frame_scope(masm_, StackFrame::MANUAL); | 130 FrameScope frame_scope(masm_, StackFrame::MANUAL); |
132 | 131 |
133 info->set_prologue_offset(masm_->pc_offset()); | 132 info->set_prologue_offset(masm_->pc_offset()); |
134 __ Prologue(info->IsCodePreAgingActive()); | 133 __ Prologue(info->IsCodePreAgingActive()); |
135 info->AddNoFrameRange(0, masm_->pc_offset()); | |
136 | 134 |
137 { Comment cmnt(masm_, "[ Allocate locals"); | 135 { Comment cmnt(masm_, "[ Allocate locals"); |
138 int locals_count = info->scope()->num_stack_slots(); | 136 int locals_count = info->scope()->num_stack_slots(); |
139 // Generators allocate locals, if any, in context slots. | 137 // Generators allocate locals, if any, in context slots. |
140 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); | 138 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); |
141 if (locals_count == 1) { | 139 if (locals_count == 1) { |
142 __ PushRoot(Heap::kUndefinedValueRootIndex); | 140 __ PushRoot(Heap::kUndefinedValueRootIndex); |
143 } else if (locals_count > 1) { | 141 } else if (locals_count > 1) { |
144 if (locals_count >= 128) { | 142 if (locals_count >= 128) { |
145 Label ok; | 143 Label ok; |
(...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 Label ok; | 430 Label ok; |
433 __ j(positive, &ok, Label::kNear); | 431 __ j(positive, &ok, Label::kNear); |
434 __ Push(rax); | 432 __ Push(rax); |
435 __ call(isolate()->builtins()->InterruptCheck(), | 433 __ call(isolate()->builtins()->InterruptCheck(), |
436 RelocInfo::CODE_TARGET); | 434 RelocInfo::CODE_TARGET); |
437 __ Pop(rax); | 435 __ Pop(rax); |
438 EmitProfilingCounterReset(); | 436 EmitProfilingCounterReset(); |
439 __ bind(&ok); | 437 __ bind(&ok); |
440 | 438 |
441 SetReturnPosition(literal()); | 439 SetReturnPosition(literal()); |
442 int no_frame_start = masm_->pc_offset(); | |
443 __ leave(); | 440 __ leave(); |
444 | 441 |
445 int arg_count = info_->scope()->num_parameters() + 1; | 442 int arg_count = info_->scope()->num_parameters() + 1; |
446 int arguments_bytes = arg_count * kPointerSize; | 443 int arguments_bytes = arg_count * kPointerSize; |
447 __ Ret(arguments_bytes, rcx); | 444 __ Ret(arguments_bytes, rcx); |
448 | |
449 info_->AddNoFrameRange(no_frame_start, masm_->pc_offset()); | |
450 } | 445 } |
451 } | 446 } |
452 | 447 |
453 | 448 |
454 void FullCodeGenerator::StackValueContext::Plug(Variable* var) const { | 449 void FullCodeGenerator::StackValueContext::Plug(Variable* var) const { |
455 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); | 450 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
456 MemOperand operand = codegen()->VarOperand(var, result_register()); | 451 MemOperand operand = codegen()->VarOperand(var, result_register()); |
457 __ Push(operand); | 452 __ Push(operand); |
458 } | 453 } |
459 | 454 |
(...skipping 4698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5158 Assembler::target_address_at(call_target_address, | 5153 Assembler::target_address_at(call_target_address, |
5159 unoptimized_code)); | 5154 unoptimized_code)); |
5160 return OSR_AFTER_STACK_CHECK; | 5155 return OSR_AFTER_STACK_CHECK; |
5161 } | 5156 } |
5162 | 5157 |
5163 | 5158 |
5164 } // namespace internal | 5159 } // namespace internal |
5165 } // namespace v8 | 5160 } // namespace v8 |
5166 | 5161 |
5167 #endif // V8_TARGET_ARCH_X64 | 5162 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |