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 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #if V8_TARGET_ARCH_ARM64 | 7 #if V8_TARGET_ARCH_ARM64 |
8 | 8 |
9 #include "src/arm64/frames-arm64.h" | 9 #include "src/arm64/frames-arm64.h" |
10 #include "src/codegen.h" | 10 #include "src/codegen.h" |
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
985 | 985 |
986 // Perform stack guard check. | 986 // Perform stack guard check. |
987 { | 987 { |
988 Label ok; | 988 Label ok; |
989 __ CompareRoot(jssp, Heap::kStackLimitRootIndex); | 989 __ CompareRoot(jssp, Heap::kStackLimitRootIndex); |
990 __ B(hs, &ok); | 990 __ B(hs, &ok); |
991 __ CallRuntime(Runtime::kStackGuard, 0); | 991 __ CallRuntime(Runtime::kStackGuard, 0); |
992 __ Bind(&ok); | 992 __ Bind(&ok); |
993 } | 993 } |
994 | 994 |
995 // Load bytecode offset and dispatch table into registers. | 995 // Load accumulator, register file, bytecode offset, dispatch table into |
| 996 // registers. |
| 997 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); |
| 998 __ Sub(kInterpreterRegisterFileRegister, fp, |
| 999 Operand(kPointerSize + StandardFrameConstants::kFixedFrameSizeFromFp)); |
996 __ Mov(kInterpreterBytecodeOffsetRegister, | 1000 __ Mov(kInterpreterBytecodeOffsetRegister, |
997 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); | 1001 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); |
998 __ LoadRoot(kInterpreterDispatchTableRegister, | 1002 __ LoadRoot(kInterpreterDispatchTableRegister, |
999 Heap::kInterpreterTableRootIndex); | 1003 Heap::kInterpreterTableRootIndex); |
1000 __ Add(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister, | 1004 __ Add(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister, |
1001 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 1005 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
1002 | 1006 |
1003 // Dispatch to the first bytecode handler for the function. | 1007 // Dispatch to the first bytecode handler for the function. |
1004 __ Ldrb(x0, MemOperand(kInterpreterBytecodeArrayRegister, | 1008 __ Ldrb(x1, MemOperand(kInterpreterBytecodeArrayRegister, |
1005 kInterpreterBytecodeOffsetRegister)); | 1009 kInterpreterBytecodeOffsetRegister)); |
1006 __ Mov(x0, Operand(x0, LSL, kPointerSizeLog2)); | 1010 __ Mov(x1, Operand(x1, LSL, kPointerSizeLog2)); |
1007 __ Ldr(ip0, MemOperand(kInterpreterDispatchTableRegister, x0)); | 1011 __ Ldr(ip0, MemOperand(kInterpreterDispatchTableRegister, x1)); |
1008 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging | 1012 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging |
1009 // and header removal. | 1013 // and header removal. |
1010 __ Add(ip0, ip0, Operand(Code::kHeaderSize - kHeapObjectTag)); | 1014 __ Add(ip0, ip0, Operand(Code::kHeaderSize - kHeapObjectTag)); |
1011 __ Jump(ip0); | 1015 __ Call(ip0); |
1012 } | 1016 } |
1013 | 1017 |
1014 | 1018 |
1015 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { | 1019 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { |
1016 // TODO(rmcilroy): List of things not currently dealt with here but done in | 1020 // TODO(rmcilroy): List of things not currently dealt with here but done in |
1017 // fullcodegen's EmitReturnSequence. | 1021 // fullcodegen's EmitReturnSequence. |
1018 // - Supporting FLAG_trace for Runtime::TraceExit. | 1022 // - Supporting FLAG_trace for Runtime::TraceExit. |
1019 // - Support profiler (specifically decrementing profiling_counter | 1023 // - Support profiler (specifically decrementing profiling_counter |
1020 // appropriately and calling out to HandleInterrupts if necessary). | 1024 // appropriately and calling out to HandleInterrupts if necessary). |
1021 | 1025 |
1022 // Load return value into x0. | 1026 // The return value is in accumulator, which is already in x0. |
1023 __ ldr(x0, MemOperand(fp, -kPointerSize - | 1027 |
1024 StandardFrameConstants::kFixedFrameSizeFromFp)); | |
1025 // Leave the frame (also dropping the register file). | 1028 // Leave the frame (also dropping the register file). |
1026 __ LeaveFrame(StackFrame::JAVA_SCRIPT); | 1029 __ LeaveFrame(StackFrame::JAVA_SCRIPT); |
1027 // Drop receiver + arguments. | 1030 // Drop receiver + arguments. |
1028 // TODO(rmcilroy): Get number of arguments from BytecodeArray. | 1031 // TODO(rmcilroy): Get number of arguments from BytecodeArray. |
1029 __ Drop(1, kXRegSize); | 1032 __ Drop(1, kXRegSize); |
1030 __ Ret(); | 1033 __ Ret(); |
1031 } | 1034 } |
1032 | 1035 |
1033 | 1036 |
1034 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { | 1037 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1930 } | 1933 } |
1931 } | 1934 } |
1932 | 1935 |
1933 | 1936 |
1934 #undef __ | 1937 #undef __ |
1935 | 1938 |
1936 } // namespace internal | 1939 } // namespace internal |
1937 } // namespace v8 | 1940 } // namespace v8 |
1938 | 1941 |
1939 #endif // V8_TARGET_ARCH_ARM | 1942 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |