| 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 952 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 963 // MANUAL indicates that the scope shouldn't actually generate code to set up | 963 // MANUAL indicates that the scope shouldn't actually generate code to set up |
| 964 // the frame (that is done below). | 964 // the frame (that is done below). |
| 965 FrameScope frame_scope(masm, StackFrame::MANUAL); | 965 FrameScope frame_scope(masm, StackFrame::MANUAL); |
| 966 | 966 |
| 967 __ Push(ra, fp, cp, a1); | 967 __ Push(ra, fp, cp, a1); |
| 968 __ Daddu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); | 968 __ Daddu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); |
| 969 | 969 |
| 970 // Get the bytecode array from the function object and load the pointer to the | 970 // Get the bytecode array from the function object and load the pointer to the |
| 971 // first entry into kInterpreterBytecodeRegister. | 971 // first entry into kInterpreterBytecodeRegister. |
| 972 __ ld(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); | 972 __ ld(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
| 973 Label load_debug_bytecode_array, bytecode_array_loaded; |
| 974 Register debug_info = kInterpreterBytecodeArrayRegister; |
| 975 DCHECK(!debug_info.is(a0)); |
| 976 __ ld(debug_info, FieldMemOperand(a0, SharedFunctionInfo::kDebugInfoOffset)); |
| 977 __ Branch(&load_debug_bytecode_array, ne, debug_info, |
| 978 Operand(DebugInfo::uninitialized())); |
| 973 __ ld(kInterpreterBytecodeArrayRegister, | 979 __ ld(kInterpreterBytecodeArrayRegister, |
| 974 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset)); | 980 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset)); |
| 981 __ bind(&bytecode_array_loaded); |
| 975 | 982 |
| 976 if (FLAG_debug_code) { | 983 if (FLAG_debug_code) { |
| 977 // Check function data field is actually a BytecodeArray object. | 984 // Check function data field is actually a BytecodeArray object. |
| 978 __ SmiTst(kInterpreterBytecodeArrayRegister, a4); | 985 __ SmiTst(kInterpreterBytecodeArrayRegister, a4); |
| 979 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, a4, | 986 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, a4, |
| 980 Operand(zero_reg)); | 987 Operand(zero_reg)); |
| 981 __ GetObjectType(kInterpreterBytecodeArrayRegister, a4, a4); | 988 __ GetObjectType(kInterpreterBytecodeArrayRegister, a4, a4); |
| 982 __ Assert(eq, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, a4, | 989 __ Assert(eq, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, a4, |
| 983 Operand(BYTECODE_ARRAY_TYPE)); | 990 Operand(BYTECODE_ARRAY_TYPE)); |
| 984 } | 991 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1036 __ lbu(a0, MemOperand(a0)); | 1043 __ lbu(a0, MemOperand(a0)); |
| 1037 __ Dlsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2); | 1044 __ Dlsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2); |
| 1038 __ ld(at, MemOperand(at)); | 1045 __ ld(at, MemOperand(at)); |
| 1039 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging | 1046 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging |
| 1040 // and header removal. | 1047 // and header removal. |
| 1041 __ Daddu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag)); | 1048 __ Daddu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| 1042 __ Call(at); | 1049 __ Call(at); |
| 1043 | 1050 |
| 1044 // Even though the first bytecode handler was called, we will never return. | 1051 // Even though the first bytecode handler was called, we will never return. |
| 1045 __ Abort(kUnexpectedReturnFromBytecodeHandler); | 1052 __ Abort(kUnexpectedReturnFromBytecodeHandler); |
| 1053 |
| 1054 // Load debug copy of the bytecode array. |
| 1055 __ bind(&load_debug_bytecode_array); |
| 1056 __ ld(kInterpreterBytecodeArrayRegister, |
| 1057 FieldMemOperand(debug_info, DebugInfo::kAbstractCodeIndex)); |
| 1058 __ Branch(&bytecode_array_loaded); |
| 1046 } | 1059 } |
| 1047 | 1060 |
| 1048 | 1061 |
| 1049 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { | 1062 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { |
| 1050 // TODO(rmcilroy): List of things not currently dealt with here but done in | 1063 // TODO(rmcilroy): List of things not currently dealt with here but done in |
| 1051 // fullcodegen's EmitReturnSequence. | 1064 // fullcodegen's EmitReturnSequence. |
| 1052 // - Supporting FLAG_trace for Runtime::TraceExit. | 1065 // - Supporting FLAG_trace for Runtime::TraceExit. |
| 1053 // - Support profiler (specifically decrementing profiling_counter | 1066 // - Support profiler (specifically decrementing profiling_counter |
| 1054 // appropriately and calling out to HandleInterrupts if necessary). | 1067 // appropriately and calling out to HandleInterrupts if necessary). |
| 1055 | 1068 |
| (...skipping 1703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2759 } | 2772 } |
| 2760 } | 2773 } |
| 2761 | 2774 |
| 2762 | 2775 |
| 2763 #undef __ | 2776 #undef __ |
| 2764 | 2777 |
| 2765 } // namespace internal | 2778 } // namespace internal |
| 2766 } // namespace v8 | 2779 } // namespace v8 |
| 2767 | 2780 |
| 2768 #endif // V8_TARGET_ARCH_MIPS64 | 2781 #endif // V8_TARGET_ARCH_MIPS64 |
| OLD | NEW |