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_MIPS | 5 #if V8_TARGET_ARCH_MIPS |
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 753 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
764 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { | 764 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { |
765 // Open a frame scope to indicate that there is a frame on the stack. The | 765 // Open a frame scope to indicate that there is a frame on the stack. The |
766 // MANUAL indicates that the scope shouldn't actually generate code to set up | 766 // MANUAL indicates that the scope shouldn't actually generate code to set up |
767 // the frame (that is done below). | 767 // the frame (that is done below). |
768 FrameScope frame_scope(masm, StackFrame::MANUAL); | 768 FrameScope frame_scope(masm, StackFrame::MANUAL); |
769 | 769 |
770 __ Push(ra, fp, cp, a1); | 770 __ Push(ra, fp, cp, a1); |
771 __ Addu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); | 771 __ Addu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); |
772 __ Push(a3); | 772 __ Push(a3); |
773 | 773 |
| 774 // Push zero for bytecode array offset. |
| 775 __ Push(zero_reg); |
| 776 |
774 // Get the bytecode array from the function object and load the pointer to the | 777 // Get the bytecode array from the function object and load the pointer to the |
775 // first entry into kInterpreterBytecodeRegister. | 778 // first entry into kInterpreterBytecodeRegister. |
776 __ lw(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); | 779 __ lw(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
777 __ lw(kInterpreterBytecodeArrayRegister, | 780 __ lw(kInterpreterBytecodeArrayRegister, |
778 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset)); | 781 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset)); |
779 | 782 |
780 if (FLAG_debug_code) { | 783 if (FLAG_debug_code) { |
781 // Check function data field is actually a BytecodeArray object. | 784 // Check function data field is actually a BytecodeArray object. |
782 __ SmiTst(kInterpreterBytecodeArrayRegister, t0); | 785 __ SmiTst(kInterpreterBytecodeArrayRegister, t0); |
783 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, t0, | 786 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, t0, |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
828 __ LoadRoot(at, Heap::kStackLimitRootIndex); | 831 __ LoadRoot(at, Heap::kStackLimitRootIndex); |
829 __ Branch(&ok, hs, sp, Operand(at)); | 832 __ Branch(&ok, hs, sp, Operand(at)); |
830 __ push(kInterpreterBytecodeArrayRegister); | 833 __ push(kInterpreterBytecodeArrayRegister); |
831 __ CallRuntime(Runtime::kStackGuard, 0); | 834 __ CallRuntime(Runtime::kStackGuard, 0); |
832 __ pop(kInterpreterBytecodeArrayRegister); | 835 __ pop(kInterpreterBytecodeArrayRegister); |
833 __ bind(&ok); | 836 __ bind(&ok); |
834 } | 837 } |
835 | 838 |
836 // Load bytecode offset and dispatch table into registers. | 839 // Load bytecode offset and dispatch table into registers. |
837 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); | 840 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); |
838 __ Subu(kInterpreterRegisterFileRegister, fp, | 841 __ Addu(kInterpreterRegisterFileRegister, fp, |
839 Operand(2 * kPointerSize + | 842 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); |
840 StandardFrameConstants::kFixedFrameSizeFromFp)); | |
841 __ li(kInterpreterBytecodeOffsetRegister, | 843 __ li(kInterpreterBytecodeOffsetRegister, |
842 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); | 844 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); |
843 __ LoadRoot(kInterpreterDispatchTableRegister, | 845 __ LoadRoot(kInterpreterDispatchTableRegister, |
844 Heap::kInterpreterTableRootIndex); | 846 Heap::kInterpreterTableRootIndex); |
845 __ Addu(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister, | 847 __ Addu(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister, |
846 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 848 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
847 | 849 |
848 // Dispatch to the first bytecode handler for the function. | 850 // Dispatch to the first bytecode handler for the function. |
849 __ Addu(a0, kInterpreterBytecodeArrayRegister, | 851 __ Addu(a0, kInterpreterBytecodeArrayRegister, |
850 kInterpreterBytecodeOffsetRegister); | 852 kInterpreterBytecodeOffsetRegister); |
(...skipping 1122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1973 } | 1975 } |
1974 } | 1976 } |
1975 | 1977 |
1976 | 1978 |
1977 #undef __ | 1979 #undef __ |
1978 | 1980 |
1979 } // namespace internal | 1981 } // namespace internal |
1980 } // namespace v8 | 1982 } // namespace v8 |
1981 | 1983 |
1982 #endif // V8_TARGET_ARCH_MIPS | 1984 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |