| 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/arm64/frames-arm64.h" | 7 #include "src/arm64/frames-arm64.h" |
| 8 #include "src/codegen.h" | 8 #include "src/codegen.h" |
| 9 #include "src/debug/debug.h" | 9 #include "src/debug/debug.h" |
| 10 #include "src/deoptimizer.h" | 10 #include "src/deoptimizer.h" |
| (...skipping 979 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 990 // | 990 // |
| 991 // The function builds an interpreter frame. See InterpreterFrameConstants in | 991 // The function builds an interpreter frame. See InterpreterFrameConstants in |
| 992 // frames.h for its layout. | 992 // frames.h for its layout. |
| 993 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { | 993 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { |
| 994 // Open a frame scope to indicate that there is a frame on the stack. The | 994 // Open a frame scope to indicate that there is a frame on the stack. The |
| 995 // MANUAL indicates that the scope shouldn't actually generate code to set up | 995 // MANUAL indicates that the scope shouldn't actually generate code to set up |
| 996 // the frame (that is done below). | 996 // the frame (that is done below). |
| 997 FrameScope frame_scope(masm, StackFrame::MANUAL); | 997 FrameScope frame_scope(masm, StackFrame::MANUAL); |
| 998 __ Push(lr, fp, cp, x1); | 998 __ Push(lr, fp, cp, x1); |
| 999 __ Add(fp, jssp, StandardFrameConstants::kFixedFrameSizeFromFp); | 999 __ Add(fp, jssp, StandardFrameConstants::kFixedFrameSizeFromFp); |
| 1000 __ Push(x3); | |
| 1001 | 1000 |
| 1002 // Push zero for bytecode array offset. | 1001 // Push dispatch table pointer. |
| 1003 __ Mov(x0, Operand(0)); | 1002 __ Mov(x0, Operand(0)); |
| 1004 __ Push(x0); | 1003 __ Mov(x2, Operand(ExternalReference::interpreter_dispatch_table_address( |
| 1004 masm->isolate()))); |
| 1005 __ Push(x3, x2, x0); |
| 1005 | 1006 |
| 1006 // Get the bytecode array from the function object and load the pointer to the | 1007 // Get the bytecode array from the function object and load the pointer to the |
| 1007 // first entry into kInterpreterBytecodeRegister. | 1008 // first entry into kInterpreterBytecodeRegister. |
| 1008 __ Ldr(x0, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset)); | 1009 __ Ldr(x0, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset)); |
| 1009 __ Ldr(kInterpreterBytecodeArrayRegister, | 1010 __ Ldr(kInterpreterBytecodeArrayRegister, |
| 1010 FieldMemOperand(x0, SharedFunctionInfo::kFunctionDataOffset)); | 1011 FieldMemOperand(x0, SharedFunctionInfo::kFunctionDataOffset)); |
| 1011 | 1012 |
| 1012 if (FLAG_debug_code) { | 1013 if (FLAG_debug_code) { |
| 1013 // Check function data field is actually a BytecodeArray object. | 1014 // Check function data field is actually a BytecodeArray object. |
| 1014 __ AssertNotSmi(kInterpreterBytecodeArrayRegister, | 1015 __ AssertNotSmi(kInterpreterBytecodeArrayRegister, |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1051 // - Call ProfileEntryHookStub when isolate has a function_entry_hook. | 1052 // - Call ProfileEntryHookStub when isolate has a function_entry_hook. |
| 1052 // - Code aging of the BytecodeArray object. | 1053 // - Code aging of the BytecodeArray object. |
| 1053 | 1054 |
| 1054 // Load accumulator, register file, bytecode offset, dispatch table into | 1055 // Load accumulator, register file, bytecode offset, dispatch table into |
| 1055 // registers. | 1056 // registers. |
| 1056 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); | 1057 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); |
| 1057 __ Add(kInterpreterRegisterFileRegister, fp, | 1058 __ Add(kInterpreterRegisterFileRegister, fp, |
| 1058 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); | 1059 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); |
| 1059 __ Mov(kInterpreterBytecodeOffsetRegister, | 1060 __ Mov(kInterpreterBytecodeOffsetRegister, |
| 1060 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); | 1061 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); |
| 1061 __ Mov(kInterpreterDispatchTableRegister, | 1062 __ Ldr(kInterpreterDispatchTableRegister, |
| 1062 Operand(ExternalReference::interpreter_dispatch_table_address( | 1063 MemOperand(fp, InterpreterFrameConstants::kDispatchTableFromFp)); |
| 1063 masm->isolate()))); | |
| 1064 | 1064 |
| 1065 // Dispatch to the first bytecode handler for the function. | 1065 // Dispatch to the first bytecode handler for the function. |
| 1066 __ Ldrb(x1, MemOperand(kInterpreterBytecodeArrayRegister, | 1066 __ Ldrb(x1, MemOperand(kInterpreterBytecodeArrayRegister, |
| 1067 kInterpreterBytecodeOffsetRegister)); | 1067 kInterpreterBytecodeOffsetRegister)); |
| 1068 __ Mov(x1, Operand(x1, LSL, kPointerSizeLog2)); | 1068 __ Mov(x1, Operand(x1, LSL, kPointerSizeLog2)); |
| 1069 __ Ldr(ip0, MemOperand(kInterpreterDispatchTableRegister, x1)); | 1069 __ Ldr(ip0, MemOperand(kInterpreterDispatchTableRegister, x1)); |
| 1070 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging | 1070 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging |
| 1071 // and header removal. | 1071 // and header removal. |
| 1072 __ Add(ip0, ip0, Operand(Code::kHeaderSize - kHeapObjectTag)); | 1072 __ Add(ip0, ip0, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| 1073 __ Call(ip0); | 1073 __ Call(ip0); |
| (...skipping 1745 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2819 } | 2819 } |
| 2820 } | 2820 } |
| 2821 | 2821 |
| 2822 | 2822 |
| 2823 #undef __ | 2823 #undef __ |
| 2824 | 2824 |
| 2825 } // namespace internal | 2825 } // namespace internal |
| 2826 } // namespace v8 | 2826 } // namespace v8 |
| 2827 | 2827 |
| 2828 #endif // V8_TARGET_ARCH_ARM | 2828 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |