| 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/code-factory.h" | 7 #include "src/code-factory.h" |
| 8 #include "src/code-stubs.h" | 8 #include "src/code-stubs.h" |
| 9 #include "src/codegen.h" | 9 #include "src/codegen.h" |
| 10 #include "src/debug/debug.h" | 10 #include "src/debug/debug.h" |
| (...skipping 4813 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4824 __ Ldr(dst, ContextMemOperand(cp, context_index)); | 4824 __ Ldr(dst, ContextMemOperand(cp, context_index)); |
| 4825 } | 4825 } |
| 4826 | 4826 |
| 4827 | 4827 |
| 4828 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { | 4828 void FullCodeGenerator::PushFunctionArgumentForContextAllocation() { |
| 4829 Scope* closure_scope = scope()->ClosureScope(); | 4829 Scope* closure_scope = scope()->ClosureScope(); |
| 4830 if (closure_scope->is_script_scope() || | 4830 if (closure_scope->is_script_scope() || |
| 4831 closure_scope->is_module_scope()) { | 4831 closure_scope->is_module_scope()) { |
| 4832 // Contexts nested in the native context have a canonical empty function | 4832 // Contexts nested in the native context have a canonical empty function |
| 4833 // as their closure, not the anonymous closure containing the global | 4833 // as their closure, not the anonymous closure containing the global |
| 4834 // code. Pass a smi sentinel and let the runtime look up the empty | 4834 // code. |
| 4835 // function. | |
| 4836 DCHECK(kSmiTag == 0); | 4835 DCHECK(kSmiTag == 0); |
| 4837 __ Push(xzr); | 4836 __ Ldr(x10, GlobalObjectMemOperand()); |
| 4837 __ Ldr(x10, FieldMemOperand(x10, JSGlobalObject::kNativeContextOffset)); |
| 4838 __ Ldr(x10, ContextMemOperand(x10, Context::CLOSURE_INDEX)); |
| 4838 } else if (closure_scope->is_eval_scope()) { | 4839 } else if (closure_scope->is_eval_scope()) { |
| 4839 // Contexts created by a call to eval have the same closure as the | 4840 // Contexts created by a call to eval have the same closure as the |
| 4840 // context calling eval, not the anonymous closure containing the eval | 4841 // context calling eval, not the anonymous closure containing the eval |
| 4841 // code. Fetch it from the context. | 4842 // code. Fetch it from the context. |
| 4842 __ Ldr(x10, ContextMemOperand(cp, Context::CLOSURE_INDEX)); | 4843 __ Ldr(x10, ContextMemOperand(cp, Context::CLOSURE_INDEX)); |
| 4843 __ Push(x10); | |
| 4844 } else { | 4844 } else { |
| 4845 DCHECK(closure_scope->is_function_scope()); | 4845 DCHECK(closure_scope->is_function_scope()); |
| 4846 __ Ldr(x10, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); | 4846 __ Ldr(x10, MemOperand(fp, JavaScriptFrameConstants::kFunctionOffset)); |
| 4847 __ Push(x10); | |
| 4848 } | 4847 } |
| 4848 __ Push(x10); |
| 4849 } | 4849 } |
| 4850 | 4850 |
| 4851 | 4851 |
| 4852 void FullCodeGenerator::EnterFinallyBlock() { | 4852 void FullCodeGenerator::EnterFinallyBlock() { |
| 4853 ASM_LOCATION("FullCodeGenerator::EnterFinallyBlock"); | 4853 ASM_LOCATION("FullCodeGenerator::EnterFinallyBlock"); |
| 4854 DCHECK(!result_register().is(x10)); | 4854 DCHECK(!result_register().is(x10)); |
| 4855 // Preserve the result register while executing finally block. | 4855 // Preserve the result register while executing finally block. |
| 4856 // Also cook the return address in lr to the stack (smi encoded Code* delta). | 4856 // Also cook the return address in lr to the stack (smi encoded Code* delta). |
| 4857 __ Sub(x10, lr, Operand(masm_->CodeObject())); | 4857 __ Sub(x10, lr, Operand(masm_->CodeObject())); |
| 4858 __ SmiTag(x10); | 4858 __ SmiTag(x10); |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5001 } | 5001 } |
| 5002 | 5002 |
| 5003 return INTERRUPT; | 5003 return INTERRUPT; |
| 5004 } | 5004 } |
| 5005 | 5005 |
| 5006 | 5006 |
| 5007 } // namespace internal | 5007 } // namespace internal |
| 5008 } // namespace v8 | 5008 } // namespace v8 |
| 5009 | 5009 |
| 5010 #endif // V8_TARGET_ARCH_ARM64 | 5010 #endif // V8_TARGET_ARCH_ARM64 |
| OLD | NEW |