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 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
180 __ Push(info->scope()->scope_info()); | 180 __ Push(info->scope()->scope_info()); |
181 __ CallRuntime(Runtime::kNewScriptContext); | 181 __ CallRuntime(Runtime::kNewScriptContext); |
182 PrepareForBailoutForId(BailoutId::ScriptContext(), | 182 PrepareForBailoutForId(BailoutId::ScriptContext(), |
183 BailoutState::TOS_REGISTER); | 183 BailoutState::TOS_REGISTER); |
184 // The new target value is not used, clobbering is safe. | 184 // The new target value is not used, clobbering is safe. |
185 DCHECK_NULL(info->scope()->new_target_var()); | 185 DCHECK_NULL(info->scope()->new_target_var()); |
186 } else { | 186 } else { |
187 if (info->scope()->new_target_var() != nullptr) { | 187 if (info->scope()->new_target_var() != nullptr) { |
188 __ Push(rdx); // Preserve new target. | 188 __ Push(rdx); // Preserve new target. |
189 } | 189 } |
190 if (slots <= FastNewFunctionContextStub::kMaximumSlots) { | 190 if (slots <= FastNewFunctionContextStub::MaximumSlots()) { |
191 FastNewFunctionContextStub stub(isolate()); | 191 FastNewFunctionContextStub stub(isolate(), info->scope()->scope_type()); |
192 __ Set(FastNewFunctionContextDescriptor::SlotsRegister(), slots); | 192 __ Set(FastNewFunctionContextDescriptor::SlotsRegister(), slots); |
193 __ CallStub(&stub); | 193 __ CallStub(&stub); |
194 // Result of FastNewFunctionContextStub is always in new space. | 194 // Result of FastNewFunctionContextStub is always in new space. |
195 need_write_barrier = false; | 195 need_write_barrier = false; |
196 } else { | 196 } else { |
197 __ Push(rdi); | 197 __ Push(rdi); |
| 198 __ Push(Smi::FromInt(info->scope()->scope_type())); |
198 __ CallRuntime(Runtime::kNewFunctionContext); | 199 __ CallRuntime(Runtime::kNewFunctionContext); |
199 } | 200 } |
200 if (info->scope()->new_target_var() != nullptr) { | 201 if (info->scope()->new_target_var() != nullptr) { |
201 __ Pop(rdx); // Restore new target. | 202 __ Pop(rdx); // Restore new target. |
202 } | 203 } |
203 } | 204 } |
204 function_in_register = false; | 205 function_in_register = false; |
205 // Context is returned in rax. It replaces the context passed to us. | 206 // Context is returned in rax. It replaces the context passed to us. |
206 // It's saved in the stack and kept live in rsi. | 207 // It's saved in the stack and kept live in rsi. |
207 __ movp(rsi, rax); | 208 __ movp(rsi, rax); |
(...skipping 2562 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2770 DCHECK_EQ( | 2771 DCHECK_EQ( |
2771 isolate->builtins()->OnStackReplacement()->entry(), | 2772 isolate->builtins()->OnStackReplacement()->entry(), |
2772 Assembler::target_address_at(call_target_address, unoptimized_code)); | 2773 Assembler::target_address_at(call_target_address, unoptimized_code)); |
2773 return ON_STACK_REPLACEMENT; | 2774 return ON_STACK_REPLACEMENT; |
2774 } | 2775 } |
2775 | 2776 |
2776 } // namespace internal | 2777 } // namespace internal |
2777 } // namespace v8 | 2778 } // namespace v8 |
2778 | 2779 |
2779 #endif // V8_TARGET_ARCH_X64 | 2780 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |