OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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_ARM64 | 5 #if V8_TARGET_ARCH_ARM64 |
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 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 __ Push(x1, x10); | 196 __ Push(x1, x10); |
197 __ CallRuntime(Runtime::kNewScriptContext); | 197 __ CallRuntime(Runtime::kNewScriptContext); |
198 PrepareForBailoutForId(BailoutId::ScriptContext(), | 198 PrepareForBailoutForId(BailoutId::ScriptContext(), |
199 BailoutState::TOS_REGISTER); | 199 BailoutState::TOS_REGISTER); |
200 // The new target value is not used, clobbering is safe. | 200 // The new target value is not used, clobbering is safe. |
201 DCHECK_NULL(info->scope()->new_target_var()); | 201 DCHECK_NULL(info->scope()->new_target_var()); |
202 } else { | 202 } else { |
203 if (info->scope()->new_target_var() != nullptr) { | 203 if (info->scope()->new_target_var() != nullptr) { |
204 __ Push(x3); // Preserve new target. | 204 __ Push(x3); // Preserve new target. |
205 } | 205 } |
206 FastNewFunctionContextStub stub(isolate()); | 206 if (slots <= FastNewFunctionContextStub::kMaximumSlots) { |
207 __ Mov(FastNewFunctionContextDescriptor::SlotsRegister(), slots); | 207 FastNewFunctionContextStub stub(isolate()); |
208 __ CallStub(&stub); | 208 __ Mov(FastNewFunctionContextDescriptor::SlotsRegister(), slots); |
209 // Result of FastNewFunctionContextStub is always in new space. | 209 __ CallStub(&stub); |
210 need_write_barrier = false; | 210 // Result of FastNewFunctionContextStub is always in new space. |
| 211 need_write_barrier = false; |
| 212 } else { |
| 213 __ Push(x1); |
| 214 __ CallRuntime(Runtime::kNewFunctionContext); |
| 215 } |
211 if (info->scope()->new_target_var() != nullptr) { | 216 if (info->scope()->new_target_var() != nullptr) { |
212 __ Pop(x3); // Restore new target. | 217 __ Pop(x3); // Restore new target. |
213 } | 218 } |
214 } | 219 } |
215 function_in_register_x1 = false; | 220 function_in_register_x1 = false; |
216 // Context is returned in x0. It replaces the context passed to us. | 221 // Context is returned in x0. It replaces the context passed to us. |
217 // It's saved in the stack and kept live in cp. | 222 // It's saved in the stack and kept live in cp. |
218 __ Mov(cp, x0); | 223 __ Mov(cp, x0); |
219 __ Str(x0, MemOperand(fp, StandardFrameConstants::kContextOffset)); | 224 __ Str(x0, MemOperand(fp, StandardFrameConstants::kContextOffset)); |
220 // Copy any necessary parameters into the context. | 225 // Copy any necessary parameters into the context. |
(...skipping 3483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3704 } | 3709 } |
3705 | 3710 |
3706 return INTERRUPT; | 3711 return INTERRUPT; |
3707 } | 3712 } |
3708 | 3713 |
3709 | 3714 |
3710 } // namespace internal | 3715 } // namespace internal |
3711 } // namespace v8 | 3716 } // namespace v8 |
3712 | 3717 |
3713 #endif // V8_TARGET_ARCH_ARM64 | 3718 #endif // V8_TARGET_ARCH_ARM64 |
OLD | NEW |