Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(275)

Side by Side Diff: src/mips64/builtins-mips64.cc

Issue 1289863003: [interpreter]: Changes to interpreter builtins for accumulator and register file registers. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@fix_interpreter_initialization
Patch Set: Rename incoming_accumulator Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/mips64/assembler-mips64.h ('k') | src/mips64/macro-assembler-mips64.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 899 matching lines...) Expand 10 before | Expand all | Expand 10 after
910 910
911 // Do a stack check to ensure we don't go over the limit. 911 // Do a stack check to ensure we don't go over the limit.
912 Label ok; 912 Label ok;
913 __ Dsubu(a5, sp, Operand(a4)); 913 __ Dsubu(a5, sp, Operand(a4));
914 __ LoadRoot(a2, Heap::kRealStackLimitRootIndex); 914 __ LoadRoot(a2, Heap::kRealStackLimitRootIndex);
915 __ Branch(&ok, hs, a5, Operand(a2)); 915 __ Branch(&ok, hs, a5, Operand(a2));
916 __ InvokeBuiltin(Builtins::STACK_OVERFLOW, CALL_FUNCTION); 916 __ InvokeBuiltin(Builtins::STACK_OVERFLOW, CALL_FUNCTION);
917 __ bind(&ok); 917 __ bind(&ok);
918 918
919 // If ok, push undefined as the initial value for all register file entries. 919 // If ok, push undefined as the initial value for all register file entries.
920 // Note: there should always be at least one stack slot for the return
921 // register in the register file.
922 Label loop_header; 920 Label loop_header;
921 Label loop_check;
923 __ LoadRoot(a5, Heap::kUndefinedValueRootIndex); 922 __ LoadRoot(a5, Heap::kUndefinedValueRootIndex);
923 __ Branch(&loop_check);
924 __ bind(&loop_header); 924 __ bind(&loop_header);
925 // TODO(rmcilroy): Consider doing more than one push per loop iteration. 925 // TODO(rmcilroy): Consider doing more than one push per loop iteration.
926 __ push(a5); 926 __ push(a5);
927 // Continue loop if not done. 927 // Continue loop if not done.
928 __ bind(&loop_check);
928 __ Dsubu(a4, a4, Operand(kPointerSize)); 929 __ Dsubu(a4, a4, Operand(kPointerSize));
929 __ Branch(&loop_header, ge, a4, Operand(zero_reg)); 930 __ Branch(&loop_header, ge, a4, Operand(zero_reg));
930 } 931 }
931 932
932 // TODO(rmcilroy): List of things not currently dealt with here but done in 933 // TODO(rmcilroy): List of things not currently dealt with here but done in
933 // fullcodegen's prologue: 934 // fullcodegen's prologue:
934 // - Support profiler (specifically profiling_counter). 935 // - Support profiler (specifically profiling_counter).
935 // - Call ProfileEntryHookStub when isolate has a function_entry_hook. 936 // - Call ProfileEntryHookStub when isolate has a function_entry_hook.
936 // - Allow simulator stop operations if FLAG_stop_at is set. 937 // - Allow simulator stop operations if FLAG_stop_at is set.
937 // - Deal with sloppy mode functions which need to replace the 938 // - Deal with sloppy mode functions which need to replace the
(...skipping 15 matching lines...) Expand all
953 // Perform stack guard check. 954 // Perform stack guard check.
954 { 955 {
955 Label ok; 956 Label ok;
956 __ LoadRoot(at, Heap::kStackLimitRootIndex); 957 __ LoadRoot(at, Heap::kStackLimitRootIndex);
957 __ Branch(&ok, hs, sp, Operand(at)); 958 __ Branch(&ok, hs, sp, Operand(at));
958 __ CallRuntime(Runtime::kStackGuard, 0); 959 __ CallRuntime(Runtime::kStackGuard, 0);
959 __ bind(&ok); 960 __ bind(&ok);
960 } 961 }
961 962
962 // Load bytecode offset and dispatch table into registers. 963 // Load bytecode offset and dispatch table into registers.
964 __ LoadRoot(kInterpreterAccumulatorRegister, Heap::kUndefinedValueRootIndex);
965 __ Dsubu(
966 kInterpreterRegisterFileRegister, fp,
967 Operand(kPointerSize + StandardFrameConstants::kFixedFrameSizeFromFp));
963 __ li(kInterpreterBytecodeOffsetRegister, 968 __ li(kInterpreterBytecodeOffsetRegister,
964 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag)); 969 Operand(BytecodeArray::kHeaderSize - kHeapObjectTag));
965 __ LoadRoot(kInterpreterDispatchTableRegister, 970 __ LoadRoot(kInterpreterDispatchTableRegister,
966 Heap::kInterpreterTableRootIndex); 971 Heap::kInterpreterTableRootIndex);
967 __ Daddu(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister, 972 __ Daddu(kInterpreterDispatchTableRegister, kInterpreterDispatchTableRegister,
968 Operand(FixedArray::kHeaderSize - kHeapObjectTag)); 973 Operand(FixedArray::kHeaderSize - kHeapObjectTag));
969 974
970 // Dispatch to the first bytecode handler for the function. 975 // Dispatch to the first bytecode handler for the function.
971 __ Daddu(a0, kInterpreterBytecodeArrayRegister, 976 __ Daddu(a0, kInterpreterBytecodeArrayRegister,
972 kInterpreterBytecodeOffsetRegister); 977 kInterpreterBytecodeOffsetRegister);
973 __ lbu(a0, MemOperand(a0)); 978 __ lbu(a0, MemOperand(a0));
974 __ dsll(at, a0, kPointerSizeLog2); 979 __ dsll(at, a0, kPointerSizeLog2);
975 __ Daddu(at, kInterpreterDispatchTableRegister, at); 980 __ Daddu(at, kInterpreterDispatchTableRegister, at);
976 __ ld(at, MemOperand(at)); 981 __ ld(at, MemOperand(at));
977 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging 982 // TODO(rmcilroy): Make dispatch table point to code entrys to avoid untagging
978 // and header removal. 983 // and header removal.
979 __ Daddu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag)); 984 __ Daddu(at, at, Operand(Code::kHeaderSize - kHeapObjectTag));
980 __ Jump(at); 985 __ Call(at);
981 } 986 }
982 987
983 988
984 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) { 989 void Builtins::Generate_InterpreterExitTrampoline(MacroAssembler* masm) {
985 // TODO(rmcilroy): List of things not currently dealt with here but done in 990 // TODO(rmcilroy): List of things not currently dealt with here but done in
986 // fullcodegen's EmitReturnSequence. 991 // fullcodegen's EmitReturnSequence.
987 // - Supporting FLAG_trace for Runtime::TraceExit. 992 // - Supporting FLAG_trace for Runtime::TraceExit.
988 // - Support profiler (specifically decrementing profiling_counter 993 // - Support profiler (specifically decrementing profiling_counter
989 // appropriately and calling out to HandleInterrupts if necessary). 994 // appropriately and calling out to HandleInterrupts if necessary).
990 995
991 // Load return value into v0. 996 // The return value is in accumulator, which is already in v0.
992 __ ld(v0, MemOperand(fp, -kPointerSize - 997
993 StandardFrameConstants::kFixedFrameSizeFromFp));
994 // Leave the frame (also dropping the register file). 998 // Leave the frame (also dropping the register file).
995 __ LeaveFrame(StackFrame::JAVA_SCRIPT); 999 __ LeaveFrame(StackFrame::JAVA_SCRIPT);
996 // Drop receiver + arguments. 1000 // Drop receiver + arguments.
997 __ Drop(1); // TODO(rmcilroy): Get number of arguments from BytecodeArray. 1001 __ Drop(1); // TODO(rmcilroy): Get number of arguments from BytecodeArray.
998 __ Jump(ra); 1002 __ Jump(ra);
999 } 1003 }
1000 1004
1001 1005
1002 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { 1006 void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
1003 CallRuntimePassFunction(masm, Runtime::kCompileLazy); 1007 CallRuntimePassFunction(masm, Runtime::kCompileLazy);
(...skipping 870 matching lines...) Expand 10 before | Expand all | Expand 10 after
1874 } 1878 }
1875 } 1879 }
1876 1880
1877 1881
1878 #undef __ 1882 #undef __
1879 1883
1880 } // namespace internal 1884 } // namespace internal
1881 } // namespace v8 1885 } // namespace v8
1882 1886
1883 #endif // V8_TARGET_ARCH_MIPS64 1887 #endif // V8_TARGET_ARCH_MIPS64
OLDNEW
« no previous file with comments | « src/mips64/assembler-mips64.h ('k') | src/mips64/macro-assembler-mips64.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698