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/full-codegen/full-codegen.h" | 7 #include "src/full-codegen/full-codegen.h" |
8 #include "src/ast/compile-time-value.h" | 8 #include "src/ast/compile-time-value.h" |
9 #include "src/ast/scopes.h" | 9 #include "src/ast/scopes.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
124 __ movp(rcx, FieldOperand(rcx, LiteralsArray::kFeedbackVectorOffset)); | 124 __ movp(rcx, FieldOperand(rcx, LiteralsArray::kFeedbackVectorOffset)); |
125 __ SmiAddConstant( | 125 __ SmiAddConstant( |
126 FieldOperand(rcx, | 126 FieldOperand(rcx, |
127 TypeFeedbackVector::kInvocationCountIndex * kPointerSize + | 127 TypeFeedbackVector::kInvocationCountIndex * kPointerSize + |
128 TypeFeedbackVector::kHeaderSize), | 128 TypeFeedbackVector::kHeaderSize), |
129 Smi::FromInt(1)); | 129 Smi::FromInt(1)); |
130 } | 130 } |
131 | 131 |
132 { Comment cmnt(masm_, "[ Allocate locals"); | 132 { Comment cmnt(masm_, "[ Allocate locals"); |
133 int locals_count = info->scope()->num_stack_slots(); | 133 int locals_count = info->scope()->num_stack_slots(); |
134 // Generators allocate locals, if any, in context slots. | |
135 DCHECK(!IsGeneratorFunction(info->literal()->kind()) || locals_count == 0); | |
136 OperandStackDepthIncrement(locals_count); | 134 OperandStackDepthIncrement(locals_count); |
137 if (locals_count == 1) { | 135 if (locals_count == 1) { |
138 __ PushRoot(Heap::kUndefinedValueRootIndex); | 136 __ PushRoot(Heap::kUndefinedValueRootIndex); |
139 } else if (locals_count > 1) { | 137 } else if (locals_count > 1) { |
140 if (locals_count >= 128) { | 138 if (locals_count >= 128) { |
141 Label ok; | 139 Label ok; |
142 __ movp(rcx, rsp); | 140 __ movp(rcx, rsp); |
143 __ subp(rcx, Immediate(locals_count * kPointerSize)); | 141 __ subp(rcx, Immediate(locals_count * kPointerSize)); |
144 __ CompareRoot(rcx, Heap::kRealStackLimitRootIndex); | 142 __ CompareRoot(rcx, Heap::kRealStackLimitRootIndex); |
145 __ j(above_equal, &ok, Label::kNear); | 143 __ j(above_equal, &ok, Label::kNear); |
(...skipping 3320 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3466 DCHECK_EQ( | 3464 DCHECK_EQ( |
3467 isolate->builtins()->OnStackReplacement()->entry(), | 3465 isolate->builtins()->OnStackReplacement()->entry(), |
3468 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3466 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3469 return ON_STACK_REPLACEMENT; | 3467 return ON_STACK_REPLACEMENT; |
3470 } | 3468 } |
3471 | 3469 |
3472 } // namespace internal | 3470 } // namespace internal |
3473 } // namespace v8 | 3471 } // namespace v8 |
3474 | 3472 |
3475 #endif // V8_TARGET_ARCH_X64 | 3473 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |