| 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 // The function builds an interpreter frame. See InterpreterFrameConstants in | 968 // The function builds an interpreter frame. See InterpreterFrameConstants in |
| 969 // frames.h for its layout. | 969 // frames.h for its layout. |
| 970 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { | 970 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { |
| 971 // Open a frame scope to indicate that there is a frame on the stack. The | 971 // Open a frame scope to indicate that there is a frame on the stack. The |
| 972 // MANUAL indicates that the scope shouldn't actually generate code to set up | 972 // MANUAL indicates that the scope shouldn't actually generate code to set up |
| 973 // the frame (that is done below). | 973 // the frame (that is done below). |
| 974 FrameScope frame_scope(masm, StackFrame::MANUAL); | 974 FrameScope frame_scope(masm, StackFrame::MANUAL); |
| 975 | 975 |
| 976 __ Push(ra, fp, cp, a1); | 976 __ Push(ra, fp, cp, a1); |
| 977 __ Addu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); | 977 __ Addu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); |
| 978 __ Push(a3); | |
| 979 | 978 |
| 980 // Push zero for bytecode array offset. | 979 // Push new.target, dispatch table pointer and zero for bytecode array offset. |
| 981 __ Push(zero_reg); | 980 __ li(a0, Operand(ExternalReference::interpreter_dispatch_table_address( |
| 981 masm->isolate()))); |
| 982 __ Push(a3, a0, zero_reg); |
| 982 | 983 |
| 983 // Get the bytecode array from the function object and load the pointer to the | 984 // Get the bytecode array from the function object and load the pointer to the |
| 984 // first entry into kInterpreterBytecodeRegister. | 985 // first entry into kInterpreterBytecodeRegister. |
| 985 __ lw(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); | 986 __ lw(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
| 986 __ lw(kInterpreterBytecodeArrayRegister, | 987 __ lw(kInterpreterBytecodeArrayRegister, |
| 987 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset)); | 988 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset)); |
| 988 | 989 |
| 989 if (FLAG_debug_code) { | 990 if (FLAG_debug_code) { |
| 990 // Check function data field is actually a BytecodeArray object. | 991 // Check function data field is actually a BytecodeArray object. |
| 991 __ SmiTst(kInterpreterBytecodeArrayRegister, t0); | 992 __ SmiTst(kInterpreterBytecodeArrayRegister, t0); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1029 // - Support profiler (specifically profiling_counter). | 1030 // - Support profiler (specifically profiling_counter). |
| 1030 // - Call ProfileEntryHookStub when isolate has a function_entry_hook. | 1031 // - Call ProfileEntryHookStub when isolate has a function_entry_hook. |
| 1031 // - Code aging of the BytecodeArray object. | 1032 // - Code aging of the BytecodeArray object. |
| 1032 | 1033 |
| 1033 // Load bytecode offset and dispatch table into registers. | 1034 // Load bytecode offset and dispatch table into registers. |
| 1034 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); | 1035 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); |
| 1035 __ Addu(kInterpreterRegisterFileRegister, fp, | 1036 __ Addu(kInterpreterRegisterFileRegister, fp, |
| 1036 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); | 1037 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); |
| 1037 __ li(kInterpreterBytecodeOffsetRegister, | 1038 __ li(kInterpreterBytecodeOffsetRegister, |
| 1038 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); | 1039 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); |
| 1039 __ li(kInterpreterDispatchTableRegister, | 1040 __ lw(kInterpreterDispatchTableRegister, |
| 1040 Operand(ExternalReference::interpreter_dispatch_table_address( | 1041 MemOperand(fp, InterpreterFrameConstants::kDispatchTableFromFp)); |
| 1041 masm->isolate()))); | |
| 1042 | 1042 |
| 1043 // Dispatch to the first bytecode handler for the function. | 1043 // Dispatch to the first bytecode handler for the function. |
| 1044 __ Addu(a0, kInterpreterBytecodeArrayRegister, | 1044 __ Addu(a0, kInterpreterBytecodeArrayRegister, |
| 1045 kInterpreterBytecodeOffsetRegister); | 1045 kInterpreterBytecodeOffsetRegister); |
| 1046 __ lbu(a0, MemOperand(a0)); | 1046 __ lbu(a0, MemOperand(a0)); |
| 1047 __ Lsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2); | 1047 __ Lsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2); |
| 1048 __ lw(at, MemOperand(at)); | 1048 __ lw(at, MemOperand(at)); |
| 1049 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging | 1049 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging |
| 1050 // and header removal. | 1050 // and header removal. |
| 1051 __ Addu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag)); | 1051 __ Addu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| (...skipping 1709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2761 } | 2761 } |
| 2762 } | 2762 } |
| 2763 | 2763 |
| 2764 | 2764 |
| 2765 #undef __ | 2765 #undef __ |
| 2766 | 2766 |
| 2767 } // namespace internal | 2767 } // namespace internal |
| 2768 } // namespace v8 | 2768 } // namespace v8 |
| 2769 | 2769 |
| 2770 #endif // V8_TARGET_ARCH_MIPS | 2770 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |