| 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/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 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 169 __ Push(info->scope()->GetScopeInfo(info->isolate())); | 169 __ Push(info->scope()->GetScopeInfo(info->isolate())); |
| 170 __ CallRuntime(Runtime::kNewScriptContext); | 170 __ CallRuntime(Runtime::kNewScriptContext); |
| 171 PrepareForBailoutForId(BailoutId::ScriptContext(), | 171 PrepareForBailoutForId(BailoutId::ScriptContext(), |
| 172 BailoutState::TOS_REGISTER); | 172 BailoutState::TOS_REGISTER); |
| 173 // The new target value is not used, clobbering is safe. | 173 // The new target value is not used, clobbering is safe. |
| 174 DCHECK_NULL(info->scope()->new_target_var()); | 174 DCHECK_NULL(info->scope()->new_target_var()); |
| 175 } else { | 175 } else { |
| 176 if (info->scope()->new_target_var() != nullptr) { | 176 if (info->scope()->new_target_var() != nullptr) { |
| 177 __ push(edx); // Preserve new target. | 177 __ push(edx); // Preserve new target. |
| 178 } | 178 } |
| 179 FastNewFunctionContextStub stub(isolate()); | 179 if (slots <= FastNewFunctionContextStub::kMaximumSlots) { |
| 180 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), | 180 FastNewFunctionContextStub stub(isolate()); |
| 181 Immediate(slots)); | 181 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), |
| 182 __ CallStub(&stub); | 182 Immediate(slots)); |
| 183 // Result of FastNewFunctionContextStub is always in new space. | 183 __ CallStub(&stub); |
| 184 need_write_barrier = false; | 184 // Result of FastNewFunctionContextStub is always in new space. |
| 185 need_write_barrier = false; |
| 186 } else { |
| 187 __ push(edi); |
| 188 __ CallRuntime(Runtime::kNewFunctionContext); |
| 189 } |
| 185 if (info->scope()->new_target_var() != nullptr) { | 190 if (info->scope()->new_target_var() != nullptr) { |
| 186 __ pop(edx); // Restore new target. | 191 __ pop(edx); // Restore new target. |
| 187 } | 192 } |
| 188 } | 193 } |
| 189 function_in_register = false; | 194 function_in_register = false; |
| 190 // Context is returned in eax. It replaces the context passed to us. | 195 // Context is returned in eax. It replaces the context passed to us. |
| 191 // It's saved in the stack and kept live in esi. | 196 // It's saved in the stack and kept live in esi. |
| 192 __ mov(esi, eax); | 197 __ mov(esi, eax); |
| 193 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), eax); | 198 __ mov(Operand(ebp, StandardFrameConstants::kContextOffset), eax); |
| 194 | 199 |
| (...skipping 3443 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3638 isolate->builtins()->OnStackReplacement()->entry(), | 3643 isolate->builtins()->OnStackReplacement()->entry(), |
| 3639 Assembler::target_address_at(call_target_address, unoptimized_code)); | 3644 Assembler::target_address_at(call_target_address, unoptimized_code)); |
| 3640 return ON_STACK_REPLACEMENT; | 3645 return ON_STACK_REPLACEMENT; |
| 3641 } | 3646 } |
| 3642 | 3647 |
| 3643 | 3648 |
| 3644 } // namespace internal | 3649 } // namespace internal |
| 3645 } // namespace v8 | 3650 } // namespace v8 |
| 3646 | 3651 |
| 3647 #endif // V8_TARGET_ARCH_X87 | 3652 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |