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_IA32 | 5 #if V8_TARGET_ARCH_IA32 |
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 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
123 __ mov(ecx, FieldOperand(edi, JSFunction::kLiteralsOffset)); | 123 __ mov(ecx, FieldOperand(edi, JSFunction::kLiteralsOffset)); |
124 __ mov(ecx, FieldOperand(ecx, LiteralsArray::kFeedbackVectorOffset)); | 124 __ mov(ecx, FieldOperand(ecx, LiteralsArray::kFeedbackVectorOffset)); |
125 __ add(FieldOperand( | 125 __ add(FieldOperand( |
126 ecx, TypeFeedbackVector::kInvocationCountIndex * kPointerSize + | 126 ecx, TypeFeedbackVector::kInvocationCountIndex * kPointerSize + |
127 TypeFeedbackVector::kHeaderSize), | 127 TypeFeedbackVector::kHeaderSize), |
128 Immediate(Smi::FromInt(1))); | 128 Immediate(Smi::FromInt(1))); |
129 } | 129 } |
130 | 130 |
131 { Comment cmnt(masm_, "[ Allocate locals"); | 131 { Comment cmnt(masm_, "[ Allocate locals"); |
132 int locals_count = info->scope()->num_stack_slots(); | 132 int locals_count = info->scope()->num_stack_slots(); |
133 // Generators allocate locals, if any, in context slots. | |
134 DCHECK(!IsGeneratorFunction(literal()->kind()) || locals_count == 0); | |
135 OperandStackDepthIncrement(locals_count); | 133 OperandStackDepthIncrement(locals_count); |
136 if (locals_count == 1) { | 134 if (locals_count == 1) { |
137 __ push(Immediate(isolate()->factory()->undefined_value())); | 135 __ push(Immediate(isolate()->factory()->undefined_value())); |
138 } else if (locals_count > 1) { | 136 } else if (locals_count > 1) { |
139 if (locals_count >= 128) { | 137 if (locals_count >= 128) { |
140 Label ok; | 138 Label ok; |
141 __ mov(ecx, esp); | 139 __ mov(ecx, esp); |
142 __ sub(ecx, Immediate(locals_count * kPointerSize)); | 140 __ sub(ecx, Immediate(locals_count * kPointerSize)); |
143 ExternalReference stack_limit = | 141 ExternalReference stack_limit = |
144 ExternalReference::address_of_real_stack_limit(isolate()); | 142 ExternalReference::address_of_real_stack_limit(isolate()); |
(...skipping 3334 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3479 isolate->builtins()->OnStackReplacement()->entry(), | 3477 isolate->builtins()->OnStackReplacement()->entry(), |
3480 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3478 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3481 return ON_STACK_REPLACEMENT; | 3479 return ON_STACK_REPLACEMENT; |
3482 } | 3480 } |
3483 | 3481 |
3484 | 3482 |
3485 } // namespace internal | 3483 } // namespace internal |
3486 } // namespace v8 | 3484 } // namespace v8 |
3487 | 3485 |
3488 #endif // V8_TARGET_ARCH_IA32 | 3486 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |