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 779 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 // frame. | 790 // frame. |
791 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { | 791 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { |
792 // Open a frame scope to indicate that there is a frame on the stack. The | 792 // Open a frame scope to indicate that there is a frame on the stack. The |
793 // MANUAL indicates that the scope shouldn't actually generate code to set up | 793 // MANUAL indicates that the scope shouldn't actually generate code to set up |
794 // the frame (that is done below). | 794 // the frame (that is done below). |
795 FrameScope frame_scope(masm, StackFrame::MANUAL); | 795 FrameScope frame_scope(masm, StackFrame::MANUAL); |
796 __ Push(lr, fp, cp, x1); | 796 __ Push(lr, fp, cp, x1); |
797 __ Add(fp, jssp, StandardFrameConstants::kFixedFrameSizeFromFp); | 797 __ Add(fp, jssp, StandardFrameConstants::kFixedFrameSizeFromFp); |
798 __ Push(x3); | 798 __ Push(x3); |
799 | 799 |
| 800 // Push zero for bytecode array offset. |
| 801 __ Mov(x0, Operand(0)); |
| 802 __ Push(x0); |
| 803 |
800 // Get the bytecode array from the function object and load the pointer to the | 804 // Get the bytecode array from the function object and load the pointer to the |
801 // first entry into kInterpreterBytecodeRegister. | 805 // first entry into kInterpreterBytecodeRegister. |
802 __ Ldr(x0, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset)); | 806 __ Ldr(x0, FieldMemOperand(x1, JSFunction::kSharedFunctionInfoOffset)); |
803 __ Ldr(kInterpreterBytecodeArrayRegister, | 807 __ Ldr(kInterpreterBytecodeArrayRegister, |
804 FieldMemOperand(x0, SharedFunctionInfo::kFunctionDataOffset)); | 808 FieldMemOperand(x0, SharedFunctionInfo::kFunctionDataOffset)); |
805 | 809 |
806 if (FLAG_debug_code) { | 810 if (FLAG_debug_code) { |
807 // Check function data field is actually a BytecodeArray object. | 811 // Check function data field is actually a BytecodeArray object. |
808 __ AssertNotSmi(kInterpreterBytecodeArrayRegister, | 812 __ AssertNotSmi(kInterpreterBytecodeArrayRegister, |
809 kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); | 813 kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry); |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
853 __ B(hs, &ok); | 857 __ B(hs, &ok); |
854 __ Push(kInterpreterBytecodeArrayRegister); | 858 __ Push(kInterpreterBytecodeArrayRegister); |
855 __ CallRuntime(Runtime::kStackGuard, 0); | 859 __ CallRuntime(Runtime::kStackGuard, 0); |
856 __ Pop(kInterpreterBytecodeArrayRegister); | 860 __ Pop(kInterpreterBytecodeArrayRegister); |
857 __ Bind(&ok); | 861 __ Bind(&ok); |
858 } | 862 } |
859 | 863 |
860 // Load accumulator, register file, bytecode offset, dispatch table into | 864 // Load accumulator, register file, bytecode offset, dispatch table into |
861 // registers. | 865 // registers. |
862 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); | 866 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); |
863 __ Sub(kInterpreterRegisterFileRegister, fp, | 867 __ Add(kInterpreterRegisterFileRegister, fp, |
864 Operand(2 * kPointerSize + | 868 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); |
865 StandardFrameConstants::kFixedFrameSizeFromFp)); | |
866 __ Mov(kInterpreterBytecodeOffsetRegister, | 869 __ Mov(kInterpreterBytecodeOffsetRegister, |
867 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); | 870 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); |
868 __ LoadRoot(kInterpreterDispatchTableRegister, | 871 __ LoadRoot(kInterpreterDispatchTableRegister, |
869 Heap::kInterpreterTableRootIndex); | 872 Heap::kInterpreterTableRootIndex); |
870 __ Add(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister, | 873 __ Add(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister, |
871 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 874 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
872 | 875 |
873 // Dispatch to the first bytecode handler for the function. | 876 // Dispatch to the first bytecode handler for the function. |
874 __ Ldrb(x1, MemOperand(kInterpreterBytecodeArrayRegister, | 877 __ Ldrb(x1, MemOperand(kInterpreterBytecodeArrayRegister, |
875 kInterpreterBytecodeOffsetRegister)); | 878 kInterpreterBytecodeOffsetRegister)); |
(...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2036 } | 2039 } |
2037 } | 2040 } |
2038 | 2041 |
2039 | 2042 |
2040 #undef __ | 2043 #undef __ |
2041 | 2044 |
2042 } // namespace internal | 2045 } // namespace internal |
2043 } // namespace v8 | 2046 } // namespace v8 |
2044 | 2047 |
2045 #endif // V8_TARGET_ARCH_ARM | 2048 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |