| 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 957 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 968 // frames.h for its layout. | 968 // frames.h for its layout. |
| 969 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { | 969 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { |
| 970 // Open a frame scope to indicate that there is a frame on the stack. The | 970 // Open a frame scope to indicate that there is a frame on the stack. The |
| 971 // MANUAL indicates that the scope shouldn't actually generate code to set up | 971 // MANUAL indicates that the scope shouldn't actually generate code to set up |
| 972 // the frame (that is done below). | 972 // the frame (that is done below). |
| 973 FrameScope frame_scope(masm, StackFrame::MANUAL); | 973 FrameScope frame_scope(masm, StackFrame::MANUAL); |
| 974 | 974 |
| 975 __ Push(ra, fp, cp, a1); | 975 __ Push(ra, fp, cp, a1); |
| 976 __ Addu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); | 976 __ Addu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); |
| 977 | 977 |
| 978 // Push new.target, dispatch table pointer and zero for bytecode array offset. | |
| 979 __ li(a0, Operand(ExternalReference::interpreter_dispatch_table_address( | |
| 980 masm->isolate()))); | |
| 981 __ Push(a3, a0, zero_reg); | |
| 982 | |
| 983 // Get the bytecode array from the function object and load the pointer to the | 978 // Get the bytecode array from the function object and load the pointer to the |
| 984 // first entry into kInterpreterBytecodeRegister. | 979 // first entry into kInterpreterBytecodeRegister. |
| 985 __ lw(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); | 980 __ lw(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
| 986 __ lw(kInterpreterBytecodeArrayRegister, | 981 __ lw(kInterpreterBytecodeArrayRegister, |
| 987 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset)); | 982 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset)); |
| 988 | 983 |
| 989 if (FLAG_debug_code) { | 984 if (FLAG_debug_code) { |
| 990 // Check function data field is actually a BytecodeArray object. | 985 // Check function data field is actually a BytecodeArray object. |
| 991 __ SmiTst(kInterpreterBytecodeArrayRegister, t0); | 986 __ SmiTst(kInterpreterBytecodeArrayRegister, t0); |
| 992 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, t0, | 987 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, t0, |
| 993 Operand(zero_reg)); | 988 Operand(zero_reg)); |
| 994 __ GetObjectType(kInterpreterBytecodeArrayRegister, t0, t0); | 989 __ GetObjectType(kInterpreterBytecodeArrayRegister, t0, t0); |
| 995 __ Assert(eq, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, t0, | 990 __ Assert(eq, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, t0, |
| 996 Operand(BYTECODE_ARRAY_TYPE)); | 991 Operand(BYTECODE_ARRAY_TYPE)); |
| 997 } | 992 } |
| 998 | 993 |
| 994 // Push new.target, bytecode array and zero for bytecode array offset. |
| 995 __ Push(a3, kInterpreterBytecodeArrayRegister, zero_reg); |
| 996 |
| 999 // Allocate the local and temporary register file on the stack. | 997 // Allocate the local and temporary register file on the stack. |
| 1000 { | 998 { |
| 1001 // Load frame size from the BytecodeArray object. | 999 // Load frame size from the BytecodeArray object. |
| 1002 __ lw(t0, FieldMemOperand(kInterpreterBytecodeArrayRegister, | 1000 __ lw(t0, FieldMemOperand(kInterpreterBytecodeArrayRegister, |
| 1003 BytecodeArray::kFrameSizeOffset)); | 1001 BytecodeArray::kFrameSizeOffset)); |
| 1004 | 1002 |
| 1005 // Do a stack check to ensure we don't go over the limit. | 1003 // Do a stack check to ensure we don't go over the limit. |
| 1006 Label ok; | 1004 Label ok; |
| 1007 __ Subu(t1, sp, Operand(t0)); | 1005 __ Subu(t1, sp, Operand(t0)); |
| 1008 __ LoadRoot(a2, Heap::kRealStackLimitRootIndex); | 1006 __ LoadRoot(a2, Heap::kRealStackLimitRootIndex); |
| (...skipping 20 matching lines...) Expand all Loading... |
| 1029 // - Support profiler (specifically profiling_counter). | 1027 // - Support profiler (specifically profiling_counter). |
| 1030 // - Call ProfileEntryHookStub when isolate has a function_entry_hook. | 1028 // - Call ProfileEntryHookStub when isolate has a function_entry_hook. |
| 1031 // - Code aging of the BytecodeArray object. | 1029 // - Code aging of the BytecodeArray object. |
| 1032 | 1030 |
| 1033 // Load bytecode offset and dispatch table into registers. | 1031 // Load bytecode offset and dispatch table into registers. |
| 1034 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); | 1032 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); |
| 1035 __ Addu(kInterpreterRegisterFileRegister, fp, | 1033 __ Addu(kInterpreterRegisterFileRegister, fp, |
| 1036 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); | 1034 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); |
| 1037 __ li(kInterpreterBytecodeOffsetRegister, | 1035 __ li(kInterpreterBytecodeOffsetRegister, |
| 1038 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); | 1036 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); |
| 1039 __ lw(kInterpreterDispatchTableRegister, | 1037 __ li(kInterpreterDispatchTableRegister, |
| 1040 MemOperand(fp, InterpreterFrameConstants::kDispatchTableFromFp)); | 1038 Operand(ExternalReference::interpreter_dispatch_table_address( |
| 1039 masm->isolate()))); |
| 1041 | 1040 |
| 1042 // Dispatch to the first bytecode handler for the function. | 1041 // Dispatch to the first bytecode handler for the function. |
| 1043 __ Addu(a0, kInterpreterBytecodeArrayRegister, | 1042 __ Addu(a0, kInterpreterBytecodeArrayRegister, |
| 1044 kInterpreterBytecodeOffsetRegister); | 1043 kInterpreterBytecodeOffsetRegister); |
| 1045 __ lbu(a0, MemOperand(a0)); | 1044 __ lbu(a0, MemOperand(a0)); |
| 1046 __ Lsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2); | 1045 __ Lsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2); |
| 1047 __ lw(at, MemOperand(at)); | 1046 __ lw(at, MemOperand(at)); |
| 1048 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging | 1047 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging |
| 1049 // and header removal. | 1048 // and header removal. |
| 1050 __ Addu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag)); | 1049 __ Addu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| (...skipping 1705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2756 } | 2755 } |
| 2757 } | 2756 } |
| 2758 | 2757 |
| 2759 | 2758 |
| 2760 #undef __ | 2759 #undef __ |
| 2761 | 2760 |
| 2762 } // namespace internal | 2761 } // namespace internal |
| 2763 } // namespace v8 | 2762 } // namespace v8 |
| 2764 | 2763 |
| 2765 #endif // V8_TARGET_ARCH_MIPS | 2764 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |