| 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" | |
| 8 #include "src/ast/compile-time-value.h" | 7 #include "src/ast/compile-time-value.h" |
| 9 #include "src/ast/scopes.h" | 8 #include "src/ast/scopes.h" |
| 9 #include "src/builtins/builtins-constructor.h" |
| 10 #include "src/code-factory.h" | 10 #include "src/code-factory.h" |
| 11 #include "src/code-stubs.h" | 11 #include "src/code-stubs.h" |
| 12 #include "src/codegen.h" | 12 #include "src/codegen.h" |
| 13 #include "src/compilation-info.h" | 13 #include "src/compilation-info.h" |
| 14 #include "src/compiler.h" | 14 #include "src/compiler.h" |
| 15 #include "src/debug/debug.h" | 15 #include "src/debug/debug.h" |
| 16 #include "src/full-codegen/full-codegen.h" |
| 16 #include "src/ic/ic.h" | 17 #include "src/ic/ic.h" |
| 17 #include "src/x87/frames-x87.h" | 18 #include "src/x87/frames-x87.h" |
| 18 | 19 |
| 19 namespace v8 { | 20 namespace v8 { |
| 20 namespace internal { | 21 namespace internal { |
| 21 | 22 |
| 22 #define __ ACCESS_MASM(masm()) | 23 #define __ ACCESS_MASM(masm()) |
| 23 | 24 |
| 24 class JumpPatchSite BASE_EMBEDDED { | 25 class JumpPatchSite BASE_EMBEDDED { |
| 25 public: | 26 public: |
| (...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 180 __ Push(info->scope()->scope_info()); | 181 __ Push(info->scope()->scope_info()); |
| 181 __ CallRuntime(Runtime::kNewScriptContext); | 182 __ CallRuntime(Runtime::kNewScriptContext); |
| 182 PrepareForBailoutForId(BailoutId::ScriptContext(), | 183 PrepareForBailoutForId(BailoutId::ScriptContext(), |
| 183 BailoutState::TOS_REGISTER); | 184 BailoutState::TOS_REGISTER); |
| 184 // The new target value is not used, clobbering is safe. | 185 // The new target value is not used, clobbering is safe. |
| 185 DCHECK_NULL(info->scope()->new_target_var()); | 186 DCHECK_NULL(info->scope()->new_target_var()); |
| 186 } else { | 187 } else { |
| 187 if (info->scope()->new_target_var() != nullptr) { | 188 if (info->scope()->new_target_var() != nullptr) { |
| 188 __ push(edx); // Preserve new target. | 189 __ push(edx); // Preserve new target. |
| 189 } | 190 } |
| 190 if (slots <= FastNewFunctionContextStub::MaximumSlots()) { | 191 if (slots <= |
| 191 FastNewFunctionContextStub stub(isolate(), info->scope()->scope_type()); | 192 ConstructorBuiltinsAssembler::MaximumFunctionContextSlots()) { |
| 193 Callable callable = CodeFactory::FastNewFunctionContext( |
| 194 isolate(), info->scope()->scope_type()); |
| 192 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), | 195 __ mov(FastNewFunctionContextDescriptor::SlotsRegister(), |
| 193 Immediate(slots)); | 196 Immediate(slots)); |
| 194 __ CallStub(&stub); | 197 __ Call(callable.code(), RelocInfo::CODE_TARGET); |
| 195 // Result of FastNewFunctionContextStub is always in new space. | 198 // Result of the FastNewFunctionContext builtin is always in new space. |
| 196 need_write_barrier = false; | 199 need_write_barrier = false; |
| 197 } else { | 200 } else { |
| 198 __ push(edi); | 201 __ push(edi); |
| 199 __ Push(Smi::FromInt(info->scope()->scope_type())); | 202 __ Push(Smi::FromInt(info->scope()->scope_type())); |
| 200 __ CallRuntime(Runtime::kNewFunctionContext); | 203 __ CallRuntime(Runtime::kNewFunctionContext); |
| 201 } | 204 } |
| 202 if (info->scope()->new_target_var() != nullptr) { | 205 if (info->scope()->new_target_var() != nullptr) { |
| 203 __ pop(edx); // Restore new target. | 206 __ pop(edx); // Restore new target. |
| 204 } | 207 } |
| 205 } | 208 } |
| (...skipping 2575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2781 isolate->builtins()->OnStackReplacement()->entry(), | 2784 isolate->builtins()->OnStackReplacement()->entry(), |
| 2782 Assembler::target_address_at(call_target_address, unoptimized_code)); | 2785 Assembler::target_address_at(call_target_address, unoptimized_code)); |
| 2783 return ON_STACK_REPLACEMENT; | 2786 return ON_STACK_REPLACEMENT; |
| 2784 } | 2787 } |
| 2785 | 2788 |
| 2786 | 2789 |
| 2787 } // namespace internal | 2790 } // namespace internal |
| 2788 } // namespace v8 | 2791 } // namespace v8 |
| 2789 | 2792 |
| 2790 #endif // V8_TARGET_ARCH_X87 | 2793 #endif // V8_TARGET_ARCH_X87 |
| OLD | NEW |