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