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_X87 | 5 #if V8_TARGET_ARCH_X87 |
6 | 6 |
7 #include "src/ast/compile-time-value.h" | 7 #include "src/ast/compile-time-value.h" |
8 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
9 #include "src/builtins/builtins-constructor.h" | 9 #include "src/builtins/builtins-constructor.h" |
10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
(...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 __ Push(info->scope()->scope_info()); | 181 __ Push(info->scope()->scope_info()); |
182 __ CallRuntime(Runtime::kNewScriptContext); | 182 __ CallRuntime(Runtime::kNewScriptContext); |
183 PrepareForBailoutForId(BailoutId::ScriptContext(), | 183 PrepareForBailoutForId(BailoutId::ScriptContext(), |
184 BailoutState::TOS_REGISTER); | 184 BailoutState::TOS_REGISTER); |
185 // The new target value is not used, clobbering is safe. | 185 // The new target value is not used, clobbering is safe. |
186 DCHECK_NULL(info->scope()->new_target_var()); | 186 DCHECK_NULL(info->scope()->new_target_var()); |
187 } else { | 187 } else { |
188 if (info->scope()->new_target_var() != nullptr) { | 188 if (info->scope()->new_target_var() != nullptr) { |
189 __ push(edx); // Preserve new target. | 189 __ push(edx); // Preserve new target. |
190 } | 190 } |
191 if (slots <= | 191 if (slots <= ConstructorBuiltins::MaximumFunctionContextSlots()) { |
192 ConstructorBuiltinsAssembler::MaximumFunctionContextSlots()) { | |
193 Callable callable = CodeFactory::FastNewFunctionContext( | 192 Callable callable = CodeFactory::FastNewFunctionContext( |
194 isolate(), info->scope()->scope_type()); | 193 isolate(), info->scope()->scope_type()); |
195 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), | 194 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), |
196 Immediate(slots)); | 195 Immediate(slots)); |
197 __ Call(callable.code(), RelocInfo::CODE_TARGET); | 196 __ Call(callable.code(), RelocInfo::CODE_TARGET); |
198 // Result of the FastNewFunctionContext builtin is always in new space. | 197 // Result of the FastNewFunctionContext builtin is always in new space. |
199 need_write_barrier = false; | 198 need_write_barrier = false; |
200 } else { | 199 } else { |
201 __ push(edi); | 200 __ push(edi); |
202 __ Push(Smi::FromInt(info->scope()->scope_type())); | 201 __ Push(Smi::FromInt(info->scope()->scope_type())); |
(...skipping 2498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2701 isolate->builtins()->OnStackReplacement()->entry(), | 2700 isolate->builtins()->OnStackReplacement()->entry(), |
2702 Assembler::target_address_at(call_target_address, unoptimized_code)); | 2701 Assembler::target_address_at(call_target_address, unoptimized_code)); |
2703 return ON_STACK_REPLACEMENT; | 2702 return ON_STACK_REPLACEMENT; |
2704 } | 2703 } |
2705 | 2704 |
2706 | 2705 |
2707 } // namespace internal | 2706 } // namespace internal |
2708 } // namespace v8 | 2707 } // namespace v8 |
2709 | 2708 |
2710 #endif // V8_TARGET_ARCH_X87 | 2709 #endif // V8_TARGET_ARCH_X87 |
OLD | NEW |