| 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 854 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 865 // Open a frame scope to indicate that there is a frame on the stack. The | 865 // Open a frame scope to indicate that there is a frame on the stack. The |
| 866 // MANUAL indicates that the scope shouldn't actually generate code to set up | 866 // MANUAL indicates that the scope shouldn't actually generate code to set up |
| 867 // the frame (that is done below). | 867 // the frame (that is done below). |
| 868 FrameScope frame_scope(masm, StackFrame::MANUAL); | 868 FrameScope frame_scope(masm, StackFrame::MANUAL); |
| 869 __ Push(lr, fp, cp, x1); | 869 __ Push(lr, fp, cp, x1); |
| 870 __ Add(fp, jssp, StandardFrameConstants::kFixedFrameSizeFromFp); | 870 __ Add(fp, jssp, StandardFrameConstants::kFixedFrameSizeFromFp); |
| 871 | 871 |
| 872 // Get the bytecode array from the function object and load the pointer to the | 872 // Get the bytecode array from the function object and load the pointer to the |
| 873 // first entry into kInterpreterBytecodeRegister. | 873 // first entry into kInterpreterBytecodeRegister. |
| 874 __ Ldr(x0, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset)); | 874 __ Ldr(x0, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset)); |
| 875 Register debug_info = kInterpreterBytecodeArrayRegister; |
| 876 Label load_debug_bytecode_array, bytecode_array_loaded; |
| 877 DCHECK(!debug_info.is(x0)); |
| 878 __ Ldr(debug_info, FieldMemOperand(x0, SharedFunctionInfo::kDebugInfoOffset)); |
| 879 __ Cmp(debug_info, Operand(DebugInfo::uninitialized())); |
| 880 __ B(ne, &load_debug_bytecode_array); |
| 875 __ Ldr(kInterpreterBytecodeArrayRegister, | 881 __ Ldr(kInterpreterBytecodeArrayRegister, |
| 876 FieldMemOperand(x0, SharedFunctionInfo::kFunctionDataOffset)); | 882 FieldMemOperand(x0, SharedFunctionInfo::kFunctionDataOffset)); |
| 883 __ Bind(&bytecode_array_loaded); |
| 877 | 884 |
| 878 if (FLAG_debug_code) { | 885 if (FLAG_debug_code) { |
| 879 // Check function data field is actually a BytecodeArray object. | 886 // Check function data field is actually a BytecodeArray object. |
| 880 __ AssertNotSmi(kInterpreterBytecodeArrayRegister, | 887 __ AssertNotSmi(kInterpreterBytecodeArrayRegister, |
| 881 kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); | 888 kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); |
| 882 __ CompareObjectType(kInterpreterBytecodeArrayRegister, x0, x0, | 889 __ CompareObjectType(kInterpreterBytecodeArrayRegister, x0, x0, |
| 883 BYTECODE_ARRAY_TYPE); | 890 BYTECODE_ARRAY_TYPE); |
| 884 __ Assert(eq, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); | 891 __ Assert(eq, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); |
| 885 } | 892 } |
| 886 | 893 |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 937 kInterpreterBytecodeOffsetRegister)); | 944 kInterpreterBytecodeOffsetRegister)); |
| 938 __ Mov(x1, Operand(x1, LSL, kPointerSizeLog2)); | 945 __ Mov(x1, Operand(x1, LSL, kPointerSizeLog2)); |
| 939 __ Ldr(ip0, MemOperand(kInterpreterDispatchTableRegister, x1)); | 946 __ Ldr(ip0, MemOperand(kInterpreterDispatchTableRegister, x1)); |
| 940 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging | 947 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging |
| 941 // and header removal. | 948 // and header removal. |
| 942 __ Add(ip0, ip0, Operand(Code::kHeaderSize - kHeapObjectTag)); | 949 __ Add(ip0, ip0, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| 943 __ Call(ip0); | 950 __ Call(ip0); |
| 944 | 951 |
| 945 // Even though the first bytecode handler was called, we will never return. | 952 // Even though the first bytecode handler was called, we will never return. |
| 946 __ Abort(kUnexpectedReturnFromBytecodeHandler); | 953 __ Abort(kUnexpectedReturnFromBytecodeHandler); |
| 954 |
| 955 // Load debug copy of the bytecode array. |
| 956 __ Bind(&load_debug_bytecode_array); |
| 957 __ Ldr(kInterpreterBytecodeArrayRegister, |
| 958 FieldMemOperand(debug_info, DebugInfo::kAbstractCodeIndex)); |
| 959 __ B(&bytecode_array_loaded); |
| 947 } | 960 } |
| 948 | 961 |
| 949 | 962 |
| 950 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { | 963 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { |
| 951 // TODO(rmcilroy): List of things not currently dealt with here but done in | 964 // TODO(rmcilroy): List of things not currently dealt with here but done in |
| 952 // fullcodegen's EmitReturnSequence. | 965 // fullcodegen's EmitReturnSequence. |
| 953 // - Supporting FLAG_trace for Runtime::TraceExit. | 966 // - Supporting FLAG_trace for Runtime::TraceExit. |
| 954 // - Support profiler (specifically decrementing profiling_counter | 967 // - Support profiler (specifically decrementing profiling_counter |
| 955 // appropriately and calling out to HandleInterrupts if necessary). | 968 // appropriately and calling out to HandleInterrupts if necessary). |
| 956 | 969 |
| (...skipping 1738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2695 } | 2708 } |
| 2696 } | 2709 } |
| 2697 | 2710 |
| 2698 | 2711 |
| 2699 #undef __ | 2712 #undef __ |
| 2700 | 2713 |
| 2701 } // namespace internal | 2714 } // namespace internal |
| 2702 } // namespace v8 | 2715 } // namespace v8 |
| 2703 | 2716 |
| 2704 #endif // V8_TARGET_ARCH_ARM | 2717 #endif // V8_TARGET_ARCH_ARM |
| OLD | NEW |