| 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 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 847 // MANUAL indicates that the scope shouldn't actually generate code to set up | 847 // MANUAL indicates that the scope shouldn't actually generate code to set up |
| 848 // the frame (that is done below). | 848 // the frame (that is done below). |
| 849 FrameScope frame_scope(masm, StackFrame::MANUAL); | 849 FrameScope frame_scope(masm, StackFrame::MANUAL); |
| 850 | 850 |
| 851 __ Push(ra, fp, cp, a1); | 851 __ Push(ra, fp, cp, a1); |
| 852 __ Addu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); | 852 __ Addu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); |
| 853 | 853 |
| 854 // Get the bytecode array from the function object and load the pointer to the | 854 // Get the bytecode array from the function object and load the pointer to the |
| 855 // first entry into kInterpreterBytecodeRegister. | 855 // first entry into kInterpreterBytecodeRegister. |
| 856 __ lw(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); | 856 __ lw(a0, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); |
| 857 Label load_debug_bytecode_array, bytecode_array_loaded; |
| 858 Register debug_info = kInterpreterBytecodeArrayRegister; |
| 859 DCHECK(!debug_info.is(a0)); |
| 860 __ lw(debug_info, FieldMemOperand(a0, SharedFunctionInfo::kDebugInfoOffset)); |
| 861 __ Branch(&load_debug_bytecode_array, ne, debug_info, |
| 862 Operand(DebugInfo::uninitialized())); |
| 857 __ lw(kInterpreterBytecodeArrayRegister, | 863 __ lw(kInterpreterBytecodeArrayRegister, |
| 858 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset)); | 864 FieldMemOperand(a0, SharedFunctionInfo::kFunctionDataOffset)); |
| 865 __ bind(&bytecode_array_loaded); |
| 859 | 866 |
| 860 if (FLAG_debug_code) { | 867 if (FLAG_debug_code) { |
| 861 // Check function data field is actually a BytecodeArray object. | 868 // Check function data field is actually a BytecodeArray object. |
| 862 __ SmiTst(kInterpreterBytecodeArrayRegister, t0); | 869 __ SmiTst(kInterpreterBytecodeArrayRegister, t0); |
| 863 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, t0, | 870 __ Assert(ne, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, t0, |
| 864 Operand(zero_reg)); | 871 Operand(zero_reg)); |
| 865 __ GetObjectType(kInterpreterBytecodeArrayRegister, t0, t0); | 872 __ GetObjectType(kInterpreterBytecodeArrayRegister, t0, t0); |
| 866 __ Assert(eq, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, t0, | 873 __ Assert(eq, kFunctionDataShouldBeBytecodeArrayOnInterpreterEntry, t0, |
| 867 Operand(BYTECODE_ARRAY_TYPE)); | 874 Operand(BYTECODE_ARRAY_TYPE)); |
| 868 } | 875 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 920 __ lbu(a0, MemOperand(a0)); | 927 __ lbu(a0, MemOperand(a0)); |
| 921 __ Lsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2); | 928 __ Lsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2); |
| 922 __ lw(at, MemOperand(at)); | 929 __ lw(at, MemOperand(at)); |
| 923 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging | 930 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging |
| 924 // and header removal. | 931 // and header removal. |
| 925 __ Addu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag)); | 932 __ Addu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag)); |
| 926 __ Call(at); | 933 __ Call(at); |
| 927 | 934 |
| 928 // Even though the first bytecode handler was called, we will never return. | 935 // Even though the first bytecode handler was called, we will never return. |
| 929 __ Abort(kUnexpectedReturnFromBytecodeHandler); | 936 __ Abort(kUnexpectedReturnFromBytecodeHandler); |
| 937 |
| 938 // Load debug copy of the bytecode array. |
| 939 __ bind(&load_debug_bytecode_array); |
| 940 __ lw(kInterpreterBytecodeArrayRegister, |
| 941 FieldMemOperand(debug_info, DebugInfo::kAbstractCodeIndex)); |
| 942 __ Branch(&bytecode_array_loaded); |
| 930 } | 943 } |
| 931 | 944 |
| 932 | 945 |
| 933 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { | 946 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { |
| 934 // TODO(rmcilroy): List of things not currently dealt with here but done in | 947 // TODO(rmcilroy): List of things not currently dealt with here but done in |
| 935 // fullcodegen's EmitReturnSequence. | 948 // fullcodegen's EmitReturnSequence. |
| 936 // - Supporting FLAG_trace for Runtime::TraceExit. | 949 // - Supporting FLAG_trace for Runtime::TraceExit. |
| 937 // - Support profiler (specifically decrementing profiling_counter | 950 // - Support profiler (specifically decrementing profiling_counter |
| 938 // appropriately and calling out to HandleInterrupts if necessary). | 951 // appropriately and calling out to HandleInterrupts if necessary). |
| 939 | 952 |
| (...skipping 1701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2641 } | 2654 } |
| 2642 } | 2655 } |
| 2643 | 2656 |
| 2644 | 2657 |
| 2645 #undef __ | 2658 #undef __ |
| 2646 | 2659 |
| 2647 } // namespace internal | 2660 } // namespace internal |
| 2648 } // namespace v8 | 2661 } // namespace v8 |
| 2649 | 2662 |
| 2650 #endif // V8_TARGET_ARCH_MIPS | 2663 #endif // V8_TARGET_ARCH_MIPS |
| OLD | NEW |