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 846 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
857 // count expected by the function. | 857 // count expected by the function. |
858 // | 858 // |
859 // The live registers are: | 859 // The live registers are: |
860 // o a1: the JS function object being called. | 860 // o a1: the JS function object being called. |
861 // o a3: the new target | 861 // o a3: the new target |
862 // o cp: our context | 862 // o cp: our context |
863 // o fp: the caller's frame pointer | 863 // o fp: the caller's frame pointer |
864 // o sp: stack pointer | 864 // o sp: stack pointer |
865 // o ra: return address | 865 // o ra: return address |
866 // | 866 // |
867 // The function builds a JS frame. Please see JavaScriptFrameConstants in | 867 // The function builds an interpreter frame. See InterpreterFrameConstants in |
868 // frames-mips.h for its layout. | 868 // frames.h for its layout. |
869 // TODO(rmcilroy): We will need to include the current bytecode pointer in the | |
870 // frame. | |
871 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { | 869 void Builtins::Generate_InterpreterEntryTrampoline(MacroAssembler* masm) { |
872 // Open a frame scope to indicate that there is a frame on the stack. The | 870 // Open a frame scope to indicate that there is a frame on the stack. The |
873 // MANUAL indicates that the scope shouldn't actually generate code to set up | 871 // MANUAL indicates that the scope shouldn't actually generate code to set up |
874 // the frame (that is done below). | 872 // the frame (that is done below). |
875 FrameScope frame_scope(masm, StackFrame::MANUAL); | 873 FrameScope frame_scope(masm, StackFrame::MANUAL); |
876 | 874 |
877 __ Push(ra, fp, cp, a1); | 875 __ Push(ra, fp, cp, a1); |
878 __ Addu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); | 876 __ Addu(fp, sp, Operand(StandardFrameConstants::kFixedFrameSizeFromFp)); |
879 __ Push(a3); | 877 __ Push(a3); |
880 | 878 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 // Dispatch to the first bytecode handler for the function. | 955 // Dispatch to the first bytecode handler for the function. |
958 __ Addu(a0, kInterpreterBytecodeArrayRegister, | 956 __ Addu(a0, kInterpreterBytecodeArrayRegister, |
959 kInterpreterBytecodeOffsetRegister); | 957 kInterpreterBytecodeOffsetRegister); |
960 __ lbu(a0, MemOperand(a0)); | 958 __ lbu(a0, MemOperand(a0)); |
961 __ Lsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2); | 959 __ Lsa(at, kInterpreterDispatchTableRegister, a0, kPointerSizeLog2); |
962 __ lw(at, MemOperand(at)); | 960 __ lw(at, MemOperand(at)); |
963 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging | 961 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging |
964 // and header removal. | 962 // and header removal. |
965 __ Addu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag)); | 963 __ Addu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag)); |
966 __ Call(at); | 964 __ Call(at); |
| 965 |
| 966 // Even though the first bytecode handler was called, we will never return. |
| 967 __ Abort(kUnexpectedReturnFromBytecodeHandler); |
967 } | 968 } |
968 | 969 |
969 | 970 |
970 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { | 971 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { |
971 // TODO(rmcilroy): List of things not currently dealt with here but done in | 972 // TODO(rmcilroy): List of things not currently dealt with here but done in |
972 // fullcodegen's EmitReturnSequence. | 973 // fullcodegen's EmitReturnSequence. |
973 // - Supporting FLAG_trace for Runtime::TraceExit. | 974 // - Supporting FLAG_trace for Runtime::TraceExit. |
974 // - Support profiler (specifically decrementing profiling_counter | 975 // - Support profiler (specifically decrementing profiling_counter |
975 // appropriately and calling out to HandleInterrupts if necessary). | 976 // appropriately and calling out to HandleInterrupts if necessary). |
976 | 977 |
(...skipping 1698 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2675 } | 2676 } |
2676 } | 2677 } |
2677 | 2678 |
2678 | 2679 |
2679 #undef __ | 2680 #undef __ |
2680 | 2681 |
2681 } // namespace internal | 2682 } // namespace internal |
2682 } // namespace v8 | 2683 } // namespace v8 |
2683 | 2684 |
2684 #endif // V8_TARGET_ARCH_MIPS | 2685 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |