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 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
182 __ Push(info->scope()->scope_info()); | 182 __ Push(info->scope()->scope_info()); |
183 __ CallRuntime(Runtime::kNewScriptContext); | 183 __ CallRuntime(Runtime::kNewScriptContext); |
184 PrepareForBailoutForId(BailoutId::ScriptContext(), | 184 PrepareForBailoutForId(BailoutId::ScriptContext(), |
185 BailoutState::TOS_REGISTER); | 185 BailoutState::TOS_REGISTER); |
186 // The new target value is not used, clobbering is safe. | 186 // The new target value is not used, clobbering is safe. |
187 DCHECK_NULL(info->scope()->new_target_var()); | 187 DCHECK_NULL(info->scope()->new_target_var()); |
188 } else { | 188 } else { |
189 if (info->scope()->new_target_var() != nullptr) { | 189 if (info->scope()->new_target_var() != nullptr) { |
190 __ Push(rdx); // Preserve new target. | 190 __ Push(rdx); // Preserve new target. |
191 } | 191 } |
192 FastNewFunctionContextStub stub(isolate()); | 192 FastNewFunctionContextStub stub(isolate(), |
| 193 info->scope()->is_eval_scope()); |
193 __ Set(FastNewFunctionContextDescriptor::SlotsRegister(), slots); | 194 __ Set(FastNewFunctionContextDescriptor::SlotsRegister(), slots); |
194 __ CallStub(&stub); | 195 __ CallStub(&stub); |
195 // Result of FastNewFunctionContextStub is always in new space. | 196 // Result of FastNewFunctionContextStub is always in new space. |
196 need_write_barrier = false; | 197 need_write_barrier = false; |
197 if (info->scope()->new_target_var() != nullptr) { | 198 if (info->scope()->new_target_var() != nullptr) { |
198 __ Pop(rdx); // Restore new target. | 199 __ Pop(rdx); // Restore new target. |
199 } | 200 } |
200 } | 201 } |
201 function_in_register = false; | 202 function_in_register = false; |
202 // Context is returned in rax. It replaces the context passed to us. | 203 // Context is returned in rax. It replaces the context passed to us. |
(...skipping 3308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3511 DCHECK_EQ( | 3512 DCHECK_EQ( |
3512 isolate->builtins()->OnStackReplacement()->entry(), | 3513 isolate->builtins()->OnStackReplacement()->entry(), |
3513 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3514 Assembler::target_address_at(call_target_address, unoptimized_code)); |
3514 return ON_STACK_REPLACEMENT; | 3515 return ON_STACK_REPLACEMENT; |
3515 } | 3516 } |
3516 | 3517 |
3517 } // namespace internal | 3518 } // namespace internal |
3518 } // namespace v8 | 3519 } // namespace v8 |
3519 | 3520 |
3520 #endif // V8_TARGET_ARCH_X64 | 3521 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |