| 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/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 2232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2243 __ Mov(x0, Operand(var->name())); | 2243 __ Mov(x0, Operand(var->name())); |
| 2244 __ Push(x0); | 2244 __ Push(x0); |
| 2245 __ CallRuntime(Runtime::kThrowReferenceError); | 2245 __ CallRuntime(Runtime::kThrowReferenceError); |
| 2246 __ bind(&uninitialized_this); | 2246 __ bind(&uninitialized_this); |
| 2247 EmitStoreToStackLocalOrContextSlot(var, location); | 2247 EmitStoreToStackLocalOrContextSlot(var, location); |
| 2248 | 2248 |
| 2249 } else if (!var->is_const_mode() || | 2249 } else if (!var->is_const_mode() || |
| 2250 (var->mode() == CONST && op == Token::INIT)) { | 2250 (var->mode() == CONST && op == Token::INIT)) { |
| 2251 if (var->IsLookupSlot()) { | 2251 if (var->IsLookupSlot()) { |
| 2252 // Assignment to var. | 2252 // Assignment to var. |
| 2253 __ Mov(x11, Operand(var->name())); | 2253 __ Push(Operand(var->name())); |
| 2254 __ Mov(x10, Smi::FromInt(language_mode())); | 2254 __ Push(x0); |
| 2255 // jssp[0] : mode. | 2255 __ CallRuntime(is_strict(language_mode()) |
| 2256 // jssp[8] : name. | 2256 ? Runtime::kStoreLookupSlot_Strict |
| 2257 // jssp[16] : context. | 2257 : Runtime::kStoreLookupSlot_Sloppy); |
| 2258 // jssp[24] : value. | |
| 2259 __ Push(x0, cp, x11, x10); | |
| 2260 __ CallRuntime(Runtime::kStoreLookupSlot); | |
| 2261 } else { | 2258 } else { |
| 2262 // Assignment to var or initializing assignment to let/const in harmony | 2259 // Assignment to var or initializing assignment to let/const in harmony |
| 2263 // mode. | 2260 // mode. |
| 2264 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); | 2261 DCHECK(var->IsStackAllocated() || var->IsContextSlot()); |
| 2265 MemOperand location = VarOperand(var, x1); | 2262 MemOperand location = VarOperand(var, x1); |
| 2266 if (FLAG_debug_code && var->mode() == LET && op == Token::INIT) { | 2263 if (FLAG_debug_code && var->mode() == LET && op == Token::INIT) { |
| 2267 __ Ldr(x10, location); | 2264 __ Ldr(x10, location); |
| 2268 __ CompareRoot(x10, Heap::kTheHoleValueRootIndex); | 2265 __ CompareRoot(x10, Heap::kTheHoleValueRootIndex); |
| 2269 __ Check(eq, kLetBindingReInitialization); | 2266 __ Check(eq, kLetBindingReInitialization); |
| 2270 } | 2267 } |
| (...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2608 if (callee->var()->IsLookupSlot()) { | 2605 if (callee->var()->IsLookupSlot()) { |
| 2609 Label slow, done; | 2606 Label slow, done; |
| 2610 SetExpressionPosition(callee); | 2607 SetExpressionPosition(callee); |
| 2611 // Generate code for loading from variables potentially shadowed | 2608 // Generate code for loading from variables potentially shadowed |
| 2612 // by eval-introduced variables. | 2609 // by eval-introduced variables. |
| 2613 EmitDynamicLookupFastCase(callee, NOT_INSIDE_TYPEOF, &slow, &done); | 2610 EmitDynamicLookupFastCase(callee, NOT_INSIDE_TYPEOF, &slow, &done); |
| 2614 | 2611 |
| 2615 __ Bind(&slow); | 2612 __ Bind(&slow); |
| 2616 // Call the runtime to find the function to call (returned in x0) | 2613 // Call the runtime to find the function to call (returned in x0) |
| 2617 // and the object holding it (returned in x1). | 2614 // and the object holding it (returned in x1). |
| 2618 __ Mov(x10, Operand(callee->name())); | 2615 __ Push(callee->name()); |
| 2619 __ Push(context_register(), x10); | 2616 __ CallRuntime(Runtime::kLoadLookupSlotForCall); |
| 2620 __ CallRuntime(Runtime::kLoadLookupSlot); | |
| 2621 __ Push(x0, x1); // Receiver, function. | 2617 __ Push(x0, x1); // Receiver, function. |
| 2622 PrepareForBailoutForId(expr->LookupId(), NO_REGISTERS); | 2618 PrepareForBailoutForId(expr->LookupId(), NO_REGISTERS); |
| 2623 | 2619 |
| 2624 // If fast case code has been generated, emit code to push the | 2620 // If fast case code has been generated, emit code to push the |
| 2625 // function and receiver and have the slow path jump around this | 2621 // function and receiver and have the slow path jump around this |
| 2626 // code. | 2622 // code. |
| 2627 if (done.is_linked()) { | 2623 if (done.is_linked()) { |
| 2628 Label call; | 2624 Label call; |
| 2629 __ B(&call); | 2625 __ B(&call); |
| 2630 __ Bind(&done); | 2626 __ Bind(&done); |
| (...skipping 2051 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4682 } | 4678 } |
| 4683 | 4679 |
| 4684 return INTERRUPT; | 4680 return INTERRUPT; |
| 4685 } | 4681 } |
| 4686 | 4682 |
| 4687 | 4683 |
| 4688 } // namespace internal | 4684 } // namespace internal |
| 4689 } // namespace v8 | 4685 } // namespace v8 |
| 4690 | 4686 |
| 4691 #endif // V8_TARGET_ARCH_ARM64 | 4687 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |