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 | 5 |
6 | 6 |
7 #include "src/v8.h" | 7 #include "src/v8.h" |
8 | 8 |
9 #if V8_TARGET_ARCH_MIPS64 | 9 #if V8_TARGET_ARCH_MIPS64 |
10 | 10 |
(...skipping 896 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
907 | 907 |
908 // Do a stack check to ensure we don't go over the limit. | 908 // Do a stack check to ensure we don't go over the limit. |
909 Label ok; | 909 Label ok; |
910 __ Dsubu(a5, sp, Operand(a4)); | 910 __ Dsubu(a5, sp, Operand(a4)); |
911 __ LoadRoot(a2, Heap::kRealStackLimitRootIndex); | 911 __ LoadRoot(a2, Heap::kRealStackLimitRootIndex); |
912 __ Branch(&ok, hs, a5, Operand(a2)); | 912 __ Branch(&ok, hs, a5, Operand(a2)); |
913 __ InvokeBuiltin(Builtins::STACK_OVERFLOW, CALL_FUNCTION); | 913 __ InvokeBuiltin(Builtins::STACK_OVERFLOW, CALL_FUNCTION); |
914 __ bind(&ok); | 914 __ bind(&ok); |
915 | 915 |
916 // If ok, push undefined as the initial value for all register file entries. | 916 // If ok, push undefined as the initial value for all register file entries. |
917 // Note: there should always be at least one stack slot for the return | |
918 // register in the register file. | |
919 Label loop_header; | 917 Label loop_header; |
| 918 Label loop_check; |
920 __ LoadRoot(a5, Heap::kUndefinedValueRootIndex); | 919 __ LoadRoot(a5, Heap::kUndefinedValueRootIndex); |
| 920 __ Branch(&loop_check); |
921 __ bind(&loop_header); | 921 __ bind(&loop_header); |
922 // TODO(rmcilroy): Consider doing more than one push per loop iteration. | 922 // TODO(rmcilroy): Consider doing more than one push per loop iteration. |
923 __ push(a5); | 923 __ push(a5); |
924 // Continue loop if not done. | 924 // Continue loop if not done. |
| 925 __ bind(&loop_check); |
925 __ Dsubu(a4, a4, Operand(kPointerSize)); | 926 __ Dsubu(a4, a4, Operand(kPointerSize)); |
926 __ Branch(&loop_header, ge, a4, Operand(zero_reg)); | 927 __ Branch(&loop_header, ge, a4, Operand(zero_reg)); |
927 } | 928 } |
928 | 929 |
929 // TODO(rmcilroy): List of things not currently dealt with here but done in | 930 // TODO(rmcilroy): List of things not currently dealt with here but done in |
930 // fullcodegen's prologue: | 931 // fullcodegen's prologue: |
931 // - Support profiler (specifically profiling_counter). | 932 // - Support profiler (specifically profiling_counter). |
932 // - Call ProfileEntryHookStub when isolate has a function_entry_hook. | 933 // - Call ProfileEntryHookStub when isolate has a function_entry_hook. |
933 // - Allow simulator stop operations if FLAG_stop_at is set. | 934 // - Allow simulator stop operations if FLAG_stop_at is set. |
934 // - Deal with sloppy mode functions which need to replace the | 935 // - Deal with sloppy mode functions which need to replace the |
(...skipping 15 matching lines...) Expand all Loading... |
950 // Perform stack guard check. | 951 // Perform stack guard check. |
951 { | 952 { |
952 Label ok; | 953 Label ok; |
953 __ LoadRoot(at, Heap::kStackLimitRootIndex); | 954 __ LoadRoot(at, Heap::kStackLimitRootIndex); |
954 __ Branch(&ok, hs, sp, Operand(at)); | 955 __ Branch(&ok, hs, sp, Operand(at)); |
955 __ CallRuntime(Runtime::kStackGuard, 0); | 956 __ CallRuntime(Runtime::kStackGuard, 0); |
956 __ bind(&ok); | 957 __ bind(&ok); |
957 } | 958 } |
958 | 959 |
959 // Load bytecode offset and dispatch table into registers. | 960 // Load bytecode offset and dispatch table into registers. |
| 961 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex); |
| 962 __ Dsubu( |
| 963 kInterpreterRegisterFileRegister, fp, |
| 964 Operand(kPointerSize + StandardFrameConstants::kFixedFrameSizeFromFp)); |
960 __ li(kInterpreterBytecodeOffsetRegister, | 965 __ li(kInterpreterBytecodeOffsetRegister, |
961 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); | 966 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); |
962 __ LoadRoot(kInterpreterDispatchTableRegister, | 967 __ LoadRoot(kInterpreterDispatchTableRegister, |
963 Heap::kInterpreterTableRootIndex); | 968 Heap::kInterpreterTableRootIndex); |
964 __ Daddu(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister, | 969 __ Daddu(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister, |
965 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); | 970 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); |
966 | 971 |
967 // Dispatch to the first bytecode handler for the function. | 972 // Dispatch to the first bytecode handler for the function. |
968 __ Daddu(a0, kInterpreterBytecodeArrayRegister, | 973 __ Daddu(a0, kInterpreterBytecodeArrayRegister, |
969 kInterpreterBytecodeOffsetRegister); | 974 kInterpreterBytecodeOffsetRegister); |
970 __ lbu(a0, MemOperand(a0)); | 975 __ lbu(a0, MemOperand(a0)); |
971 __ dsll(at, a0, kPointerSizeLog2); | 976 __ dsll(at, a0, kPointerSizeLog2); |
972 __ Daddu(at, kInterpreterDispatchTableRegister, at); | 977 __ Daddu(at, kInterpreterDispatchTableRegister, at); |
973 __ ld(at, MemOperand(at)); | 978 __ ld(at, MemOperand(at)); |
974 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging | 979 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging |
975 // and header removal. | 980 // and header removal. |
976 __ Daddu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag)); | 981 __ Daddu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag)); |
977 __ Jump(at); | 982 __ Call(at); |
978 } | 983 } |
979 | 984 |
980 | 985 |
981 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { | 986 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { |
982 // TODO(rmcilroy): List of things not currently dealt with here but done in | 987 // TODO(rmcilroy): List of things not currently dealt with here but done in |
983 // fullcodegen's EmitReturnSequence. | 988 // fullcodegen's EmitReturnSequence. |
984 // - Supporting FLAG_trace for Runtime::TraceExit. | 989 // - Supporting FLAG_trace for Runtime::TraceExit. |
985 // - Support profiler (specifically decrementing profiling_counter | 990 // - Support profiler (specifically decrementing profiling_counter |
986 // appropriately and calling out to HandleInterrupts if necessary). | 991 // appropriately and calling out to HandleInterrupts if necessary). |
987 | 992 |
988 // Load return value into v0. | 993 // The return value is in accumulator, which is already in v0. |
989 __ ld(v0, MemOperand(fp, -kPointerSize - | 994 |
990 StandardFrameConstants::kFixedFrameSizeFromFp)); | |
991 // Leave the frame (also dropping the register file). | 995 // Leave the frame (also dropping the register file). |
992 __ LeaveFrame(StackFrame::JAVA_SCRIPT); | 996 __ LeaveFrame(StackFrame::JAVA_SCRIPT); |
993 // Drop receiver + arguments. | 997 // Drop receiver + arguments. |
994 __ Drop(1); // TODO(rmcilroy): Get number of arguments from BytecodeArray. | 998 __ Drop(1); // TODO(rmcilroy): Get number of arguments from BytecodeArray. |
995 __ Jump(ra); | 999 __ Jump(ra); |
996 } | 1000 } |
997 | 1001 |
998 | 1002 |
999 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { | 1003 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { |
1000 CallRuntimePassFunction(masm, Runtime::kCompileLazy); | 1004 CallRuntimePassFunction(masm, Runtime::kCompileLazy); |
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1871 } | 1875 } |
1872 } | 1876 } |
1873 | 1877 |
1874 | 1878 |
1875 #undef __ | 1879 #undef __ |
1876 | 1880 |
1877 } // namespace internal | 1881 } // namespace internal |
1878 } // namespace v8 | 1882 } // namespace v8 |
1879 | 1883 |
1880 #endif // V8_TARGET_ARCH_MIPS64 | 1884 #endif // V8_TARGET_ARCH_MIPS64 |
OLD | NEW |