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 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
936 kInterpreterBytecodeOffsetRegister)); | 943 kInterpreterBytecodeOffsetRegister)); |
937 __ Mov(x1, Operand(x1, LSL, kPointerSizeLog2)); | 944 __ Mov(x1, Operand(x1, LSL, kPointerSizeLog2)); |
938 __ Ldr(ip0, MemOperand(kInterpreterDispatchTableRegister, x1)); | 945 __ Ldr(ip0, MemOperand(kInterpreterDispatchTableRegister, x1)); |
939 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging | 946 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging |
940 // and header removal. | 947 // and header removal. |
941 __ Add(ip0, ip0, Operand(Code::kHeaderSize - kHeapObjectTag)); | 948 __ Add(ip0, ip0, Operand(Code::kHeaderSize - kHeapObjectTag)); |
942 __ Call(ip0); | 949 __ Call(ip0); |
943 | 950 |
944 // Even though the first bytecode handler was called, we will never return. | 951 // Even though the first bytecode handler was called, we will never return. |
945 __ Abort(kUnexpectedReturnFromBytecodeHandler); | 952 __ Abort(kUnexpectedReturnFromBytecodeHandler); |
| 953 |
| 954 // Load debug copy of the bytecode array. |
| 955 __ Bind(&load_debug_bytecode_array); |
| 956 __ Ldr(kInterpreterBytecodeArrayRegister, |
| 957 FieldMemOperand(debug_info, DebugInfo::kAbstractCodeIndex)); |
| 958 __ B(&bytecode_array_loaded); |
946 } | 959 } |
947 | 960 |
948 | 961 |
949 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { | 962 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { |
950 // TODO(rmcilroy): List of things not currently dealt with here but done in | 963 // TODO(rmcilroy): List of things not currently dealt with here but done in |
951 // fullcodegen's EmitReturnSequence. | 964 // fullcodegen's EmitReturnSequence. |
952 // - Supporting FLAG_trace for Runtime::TraceExit. | 965 // - Supporting FLAG_trace for Runtime::TraceExit. |
953 // - Support profiler (specifically decrementing profiling_counter | 966 // - Support profiler (specifically decrementing profiling_counter |
954 // appropriately and calling out to HandleInterrupts if necessary). | 967 // appropriately and calling out to HandleInterrupts if necessary). |
955 | 968 |
(...skipping 1738 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2694 } | 2707 } |
2695 } | 2708 } |
2696 | 2709 |
2697 | 2710 |
2698 #undef __ | 2711 #undef __ |
2699 | 2712 |
2700 } // namespace internal | 2713 } // namespace internal |
2701 } // namespace v8 | 2714 } // namespace v8 |
2702 | 2715 |
2703 #endif // V8_TARGET_ARCH_ARM | 2716 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |