| 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/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(edx); // Preserve new target. | 188 __ push(edx); // 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 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), | 192 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), |
| 193 Immediate(slots)); | 193 Immediate(slots)); |
| 194 __ CallStub(&stub); | 194 __ CallStub(&stub); |
| 195 // Result of FastNewFunctionContextStub is always in new space. | 195 // Result of FastNewFunctionContextStub is always in new space. |
| 196 need_write_barrier = false; | 196 need_write_barrier = false; |
| 197 } else { | 197 } else { |
| 198 __ push(edi); | 198 __ push(edi); |
| 199 __ Push(Smi::FromInt(info->scope()->scope_type())); |
| 199 __ CallRuntime(Runtime::kNewFunctionContext); | 200 __ CallRuntime(Runtime::kNewFunctionContext); |
| 200 } | 201 } |
| 201 if (info->scope()->new_target_var() != nullptr) { | 202 if (info->scope()->new_target_var() != nullptr) { |
| 202 __ pop(edx); // Restore new target. | 203 __ pop(edx); // Restore new target. |
| 203 } | 204 } |
| 204 } | 205 } |
| 205 function_in_register = false; | 206 function_in_register = false; |
| 206 // Context is returned in eax. It replaces the context passed to us. | 207 // Context is returned in eax. It replaces the context passed to us. |
| 207 // It's saved in the stack and kept live in esi. | 208 // It's saved in the stack and kept live in esi. |
| 208 __ mov(esi, eax); | 209 __ mov(esi, eax); |
| (...skipping 2571 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2780 isolate->builtins()->OnStackReplacement()->entry(), | 2781 isolate->builtins()->OnStackReplacement()->entry(), |
| 2781 Assembler::target_address_at(call_target_address, unoptimized_code)); | 2782 Assembler::target_address_at(call_target_address, unoptimized_code)); |
| 2782 return ON_STACK_REPLACEMENT; | 2783 return ON_STACK_REPLACEMENT; |
| 2783 } | 2784 } |
| 2784 | 2785 |
| 2785 | 2786 |
| 2786 } // namespace internal | 2787 } // namespace internal |
| 2787 } // namespace v8 | 2788 } // namespace v8 |
| 2788 | 2789 |
| 2789 #endif // V8_TARGET_ARCH_X87 | 2790 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |