Chromium Code Reviews| 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 959 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 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); | 978 __ Push(a3); |
| 979 | 979 |
| 980 // Push dispatch table pointer. | |
| 981 __ li(a0, Operand(ExternalReference::interpreter_dispatch_table_address( | |
| 982 masm->isolate()))); | |
| 983 __ push(a0); | |
| 980 // Push zero for bytecode array offset. | 984 // Push zero for bytecode array offset. |
| 981 __ Push(zero_reg); | 985 __ Push(zero_reg); |
|
balazs.kilvady
2016/02/11 10:44:01
You could use __ Push(a0, zero_reg); to save one a
rmcilroy
2016/02/11 12:30:12
Good idea, done. Also pulled in the pushing of new
| |
| 982 | 986 |
| 983 // Get the bytecode array from the function object and load the pointer to the | 987 // Get the bytecode array from the function object and load the pointer to the |
| 984 // first entry into kInterpreterBytecodeRegister. | 988 // first entry into kInterpreterBytecodeRegister. |
| 985 __ lw(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); | 989 __ lw(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
| 986 __ lw(kInterpreterBytecodeArrayRegister, | 990 __ lw(kInterpreterBytecodeArrayRegister, |
| 987 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset)); | 991 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset)); |
| 988 | 992 |
| 989 if (FLAG_debug_code) { | 993 if (FLAG_debug_code) { |
| 990 // Check function data field is actually a BytecodeArray object. | 994 // Check function data field is actually a BytecodeArray object. |
| 991 __ SmiTst(kInterpreterBytecodeArrayRegister, t0); | 995 __ SmiTst(kInterpreterBytecodeArrayRegister, t0); |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1029 // - Support profiler (specifically profiling_counter). | 1033 // - Support profiler (specifically profiling_counter). |
| 1030 // - Call ProfileEntryHookStub when isolate has a function_entry_hook. | 1034 // - Call ProfileEntryHookStub when isolate has a function_entry_hook. |
| 1031 // - Code aging of the BytecodeArray object. | 1035 // - Code aging of the BytecodeArray object. |
| 1032 | 1036 |
| 1033 // Load bytecode offset and dispatch table into registers. | 1037 // Load bytecode offset and dispatch table into registers. |
| 1034 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); | 1038 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); |
| 1035 __ Addu(kInterpreterRegisterFileRegister, fp, | 1039 __ Addu(kInterpreterRegisterFileRegister, fp, |
| 1036 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); | 1040 Operand(InterpreterFrameConstants::kRegisterFilePointerFromFp)); |
| 1037 __ li(kInterpreterBytecodeOffsetRegister, | 1041 __ li(kInterpreterBytecodeOffsetRegister, |
| 1038 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); | 1042 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); |
| 1039 __ li(kInterpreterDispatchTableRegister, | 1043 __ lw(kInterpreterDispatchTableRegister, |
| 1040 Operand(ExternalReference::interpreter_dispatch_table_address( | 1044 MemOperand(fp, InterpreterFrameConstants::kDispatchTableFromFp)); |
| 1041 masm->isolate()))); | |
| 1042 | 1045 |
| 1043 // Dispatch to the first bytecode handler for the function. | 1046 // Dispatch to the first bytecode handler for the function. |
| 1044 __ Addu(a0, kInterpreterBytecodeArrayRegister, | 1047 __ Addu(a0, kInterpreterBytecodeArrayRegister, |
| 1045 kInterpreterBytecodeOffsetRegister); | 1048 kInterpreterBytecodeOffsetRegister); |
| 1046 __ lbu(a0, MemOperand(a0)); | 1049 __ lbu(a0, MemOperand(a0)); |
| 1047 __ Lsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2); | 1050 __ Lsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2); |
| 1048 __ lw(at, MemOperand(at)); | 1051 __ lw(at, MemOperand(at)); |
| 1049 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging | 1052 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging |
| 1050 // and header removal. | 1053 // and header removal. |
| 1051 __ Addu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag)); | 1054 __ Addu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| (...skipping 1709 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2761 } | 2764 } |
| 2762 } | 2765 } |
| 2763 | 2766 |
| 2764 | 2767 |
| 2765 #undef __ | 2768 #undef __ |
| 2766 | 2769 |
| 2767 } // namespace internal | 2770 } // namespace internal |
| 2768 } // namespace v8 | 2771 } // namespace v8 |
| 2769 | 2772 |
| 2770 #endif // V8_TARGET_ARCH_MIPS | 2773 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |