| 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/ast/scopes.h" | 7 #include "src/ast/scopes.h" |
| 8 #include "src/code-factory.h" | 8 #include "src/code-factory.h" |
| 9 #include "src/code-stubs.h" | 9 #include "src/code-stubs.h" |
| 10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 __ Push(info->scope()->GetScopeInfo(info->isolate())); | 168 __ Push(info->scope()->GetScopeInfo(info->isolate())); |
| 169 __ CallRuntime(Runtime::kNewScriptContext); | 169 __ CallRuntime(Runtime::kNewScriptContext); |
| 170 PrepareForBailoutForId(BailoutId::ScriptContext(), | 170 PrepareForBailoutForId(BailoutId::ScriptContext(), |
| 171 BailoutState::TOS_REGISTER); | 171 BailoutState::TOS_REGISTER); |
| 172 // The new target value is not used, clobbering is safe. | 172 // The new target value is not used, clobbering is safe. |
| 173 DCHECK_NULL(info->scope()->new_target_var()); | 173 DCHECK_NULL(info->scope()->new_target_var()); |
| 174 } else { | 174 } else { |
| 175 if (info->scope()->new_target_var() != nullptr) { | 175 if (info->scope()->new_target_var() != nullptr) { |
| 176 __ Push(rdx); // Preserve new target. | 176 __ Push(rdx); // Preserve new target. |
| 177 } | 177 } |
| 178 FastNewFunctionContextStub stub(isolate()); | 178 if (slots <= FastNewFunctionContextStub::kMaximumSlots) { |
| 179 __ Set(FastNewFunctionContextDescriptor::SlotsRegister(), slots); | 179 FastNewFunctionContextStub stub(isolate()); |
| 180 __ CallStub(&stub); | 180 __ Set(FastNewFunctionContextDescriptor::SlotsRegister(), slots); |
| 181 // Result of FastNewFunctionContextStub is always in new space. | 181 __ CallStub(&stub); |
| 182 need_write_barrier = false; | 182 // Result of FastNewFunctionContextStub is always in new space. |
| 183 need_write_barrier = false; |
| 184 } else { |
| 185 __ Push(rdi); |
| 186 __ CallRuntime(Runtime::kNewFunctionContext); |
| 187 } |
| 183 if (info->scope()->new_target_var() != nullptr) { | 188 if (info->scope()->new_target_var() != nullptr) { |
| 184 __ Pop(rdx); // Restore new target. | 189 __ Pop(rdx); // Restore new target. |
| 185 } | 190 } |
| 186 } | 191 } |
| 187 function_in_register = false; | 192 function_in_register = false; |
| 188 // Context is returned in rax. It replaces the context passed to us. | 193 // Context is returned in rax. It replaces the context passed to us. |
| 189 // It's saved in the stack and kept live in rsi. | 194 // It's saved in the stack and kept live in rsi. |
| 190 __ movp(rsi, rax); | 195 __ movp(rsi, rax); |
| 191 __ movp(Operand(rbp, StandardFrameConstants::kContextOffset), rax); | 196 __ movp(Operand(rbp, StandardFrameConstants::kContextOffset), rax); |
| 192 | 197 |
| (...skipping 3443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3636 DCHECK_EQ( | 3641 DCHECK_EQ( |
| 3637 isolate->builtins()->OnStackReplacement()->entry(), | 3642 isolate->builtins()->OnStackReplacement()->entry(), |
| 3638 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3643 Assembler::target_address_at(call_target_address, unoptimized_code)); |
| 3639 return ON_STACK_REPLACEMENT; | 3644 return ON_STACK_REPLACEMENT; |
| 3640 } | 3645 } |
| 3641 | 3646 |
| 3642 } // namespace internal | 3647 } // namespace internal |
| 3643 } // namespace v8 | 3648 } // namespace v8 |
| 3644 | 3649 |
| 3645 #endif // V8_TARGET_ARCH_X64 | 3650 #endif // V8_TARGET_ARCH_X64 |
| OLD | NEW |