OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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_MIPS64 | 5 #if V8_TARGET_ARCH_MIPS64 |
6 | 6 |
7 #include "src/codegen.h" | 7 #include "src/codegen.h" |
8 #include "src/debug/debug.h" | 8 #include "src/debug/debug.h" |
9 #include "src/deoptimizer.h" | 9 #include "src/deoptimizer.h" |
10 #include "src/full-codegen/full-codegen.h" | 10 #include "src/full-codegen/full-codegen.h" |
(...skipping 744 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
755 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { | 755 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { |
756 // Open a frame scope to indicate that there is a frame on the stack. The | 756 // Open a frame scope to indicate that there is a frame on the stack. The |
757 // MANUAL indicates that the scope shouldn't actually generate code to set up | 757 // MANUAL indicates that the scope shouldn't actually generate code to set up |
758 // the frame (that is done below). | 758 // the frame (that is done below). |
759 FrameScope frame_scope(masm, StackFrame::MANUAL); | 759 FrameScope frame_scope(masm, StackFrame::MANUAL); |
760 | 760 |
761 __ Push(ra, fp, cp, a1); | 761 __ Push(ra, fp, cp, a1); |
762 __ Daddu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); | 762 __ Daddu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); |
763 __ Push(a3); | 763 __ Push(a3); |
764 | 764 |
| 765 // Push zero for bytecode array offset. |
| 766 __ Push(zero_reg); |
| 767 |
765 // Get the bytecode array from the function object and load the pointer to the | 768 // Get the bytecode array from the function object and load the pointer to the |
766 // first entry into kInterpreterBytecodeRegister. | 769 // first entry into kInterpreterBytecodeRegister. |
767 __ ld(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); | 770 __ ld(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
768 __ ld(kInterpreterBytecodeArrayRegister, | 771 __ ld(kInterpreterBytecodeArrayRegister, |
769 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset)); | 772 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset)); |
770 | 773 |
771 if (FLAG_debug_code) { | 774 if (FLAG_debug_code) { |
772 // Check function data field is actually a BytecodeArray object. | 775 // Check function data field is actually a BytecodeArray object. |
773 __ SmiTst(kInterpreterBytecodeArrayRegister, a4); | 776 __ SmiTst(kInterpreterBytecodeArrayRegister, a4); |
774 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, a4, | 777 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, a4, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
819 __ LoadRoot(at, Heap::kStackLimitRootIndex); | 822 __ LoadRoot(at, Heap::kStackLimitRootIndex); |
820 __ Branch(&ok, hs, sp, Operand(at)); | 823 __ Branch(&ok, hs, sp, Operand(at)); |
821 __ push(kInterpreterBytecodeArrayRegister); | 824 __ push(kInterpreterBytecodeArrayRegister); |
822 __ CallRuntime(Runtime::kStackGuard, 0); | 825 __ CallRuntime(Runtime::kStackGuard, 0); |
823 __ pop(kInterpreterBytecodeArrayRegister); | 826 __ pop(kInterpreterBytecodeArrayRegister); |
824 __ bind(&ok); | 827 __ bind(&ok); |
825 } | 828 } |
826 | 829 |
827 // Load bytecode offset and dispatch table into registers. | 830 // Load bytecode offset and dispatch table into registers. |
828 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); | 831 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); |
829 __ Dsubu(kInterpreterRegisterFileRegister, fp, | 832 __ Daddu(kInterpreterRegisterFileRegister, fp, |
830 Operand(2 * kPointerSize + | 833 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); |
831 StandardFrameConstants::kFixedFrameSizeFromFp)); | |
832 __ li(kInterpreterBytecodeOffsetRegister, | 834 __ li(kInterpreterBytecodeOffsetRegister, |
833 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); | 835 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); |
834 __ LoadRoot(kInterpreterDispatchTableRegister, | 836 __ LoadRoot(kInterpreterDispatchTableRegister, |
835 Heap::kInterpreterTableRootIndex); | 837 Heap::kInterpreterTableRootIndex); |
836 __ Daddu(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister, | 838 __ Daddu(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister, |
837 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 839 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
838 | 840 |
839 // Dispatch to the first bytecode handler for the function. | 841 // Dispatch to the first bytecode handler for the function. |
840 __ Daddu(a0, kInterpreterBytecodeArrayRegister, | 842 __ Daddu(a0, kInterpreterBytecodeArrayRegister, |
841 kInterpreterBytecodeOffsetRegister); | 843 kInterpreterBytecodeOffsetRegister); |
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1964 } | 1966 } |
1965 } | 1967 } |
1966 | 1968 |
1967 | 1969 |
1968 #undef __ | 1970 #undef __ |
1969 | 1971 |
1970 } // namespace internal | 1972 } // namespace internal |
1971 } // namespace v8 | 1973 } // namespace v8 |
1972 | 1974 |
1973 #endif // V8_TARGET_ARCH_MIPS64 | 1975 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |