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

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

Issue 1379933003: Revert of [Interpreter] Add CallRuntime support to the interpreter. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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/interpreter/interpreter.cc ('k') | src/mips/code-stubs-mips.cc » ('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 #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 945 matching lines...) Expand 10 before | Expand all | Expand 10 after
956 __ LeaveFrame(StackFrame::JAVA_SCRIPT); 956 __ LeaveFrame(StackFrame::JAVA_SCRIPT);
957 957
958 // Drop receiver + arguments and return. 958 // Drop receiver + arguments and return.
959 __ lw(at, FieldMemOperand(kInterpreterBytecodeArrayRegister, 959 __ lw(at, FieldMemOperand(kInterpreterBytecodeArrayRegister,
960 BytecodeArray::kParameterSizeOffset)); 960 BytecodeArray::kParameterSizeOffset));
961 __ Addu(sp, sp, at); 961 __ Addu(sp, sp, at);
962 __ Jump(ra); 962 __ Jump(ra);
963 } 963 }
964 964
965 965
966 // static
967 void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) {
968 // ----------- S t a t e -------------
969 // -- a0 : the number of arguments (not including the receiver)
970 // -- a2 : the address of the first argument to be pushed. Subsequent
971 // arguments should be consecutive above this, in the same order as
972 // they are to be pushed onto the stack.
973 // -- a1 : the target to call (can be any Object).
974
975 // Find the address of the last argument.
976 __ Addu(a3, a0, Operand(1)); // Add one for receiver.
977 __ sll(a3, a3, kPointerSizeLog2);
978 __ Subu(a3, a2, Operand(a3));
979
980 // Push the arguments.
981 Label loop_header, loop_check;
982 __ Branch(&loop_check);
983 __ bind(&loop_header);
984 __ lw(t0, MemOperand(a2));
985 __ Addu(a2, a2, Operand(-kPointerSize));
986 __ push(t0);
987 __ bind(&loop_check);
988 __ Branch(&loop_header, gt, a2, Operand(a3));
989
990 // Call the target.
991 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
992 }
993
994
995 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { 966 void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
996 CallRuntimePassFunction(masm, Runtime::kCompileLazy); 967 CallRuntimePassFunction(masm, Runtime::kCompileLazy);
997 GenerateTailCallToReturnedCode(masm); 968 GenerateTailCallToReturnedCode(masm);
998 } 969 }
999 970
1000 971
1001 static void CallCompileOptimized(MacroAssembler* masm, bool concurrent) { 972 static void CallCompileOptimized(MacroAssembler* masm, bool concurrent) {
1002 FrameScope scope(masm, StackFrame::INTERNAL); 973 FrameScope scope(masm, StackFrame::INTERNAL);
1003 // Push a copy of the function onto the stack. 974 // Push a copy of the function onto the stack.
1004 // Push function as parameter to the runtime call. 975 // Push function as parameter to the runtime call.
(...skipping 727 matching lines...) Expand 10 before | Expand all | Expand 10 after
1732 // method. 1703 // method.
1733 __ bind(&non_constructor); 1704 __ bind(&non_constructor);
1734 { 1705 {
1735 FrameScope scope(masm, StackFrame::INTERNAL); 1706 FrameScope scope(masm, StackFrame::INTERNAL);
1736 __ Push(a1); 1707 __ Push(a1);
1737 __ CallRuntime(Runtime::kThrowCalledNonCallable, 1); 1708 __ CallRuntime(Runtime::kThrowCalledNonCallable, 1);
1738 } 1709 }
1739 } 1710 }
1740 1711
1741 1712
1713 // static
1714 void Builtins::Generate_PushArgsAndCall(MacroAssembler* masm) {
1715 // ----------- S t a t e -------------
1716 // -- a0 : the number of arguments (not including the receiver)
1717 // -- a2 : the address of the first argument to be pushed. Subsequent
1718 // arguments should be consecutive above this, in the same order as
1719 // they are to be pushed onto the stack.
1720 // -- a1 : the target to call (can be any Object).
1721
1722 // Find the address of the last argument.
1723 __ Addu(a3, a0, Operand(1)); // Add one for receiver.
1724 __ sll(a3, a3, kPointerSizeLog2);
1725 __ Subu(a3, a2, Operand(a3));
1726
1727 // Push the arguments.
1728 Label loop_header, loop_check;
1729 __ Branch(&loop_check);
1730 __ bind(&loop_header);
1731 __ lw(t0, MemOperand(a2));
1732 __ Addu(a2, a2, Operand(-kPointerSize));
1733 __ push(t0);
1734 __ bind(&loop_check);
1735 __ Branch(&loop_header, gt, a2, Operand(a3));
1736
1737 // Call the target.
1738 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
1739 }
1740
1741
1742 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) { 1742 void Builtins::Generate_ArgumentsAdaptorTrampoline(MacroAssembler* masm) {
1743 // State setup as expected by MacroAssembler::InvokePrologue. 1743 // State setup as expected by MacroAssembler::InvokePrologue.
1744 // ----------- S t a t e ------------- 1744 // ----------- S t a t e -------------
1745 // -- a0: actual arguments count 1745 // -- a0: actual arguments count
1746 // -- a1: function (passed through to callee) 1746 // -- a1: function (passed through to callee)
1747 // -- a2: expected arguments count 1747 // -- a2: expected arguments count
1748 // ----------------------------------- 1748 // -----------------------------------
1749 1749
1750 Label stack_overflow; 1750 Label stack_overflow;
1751 ArgumentAdaptorStackCheck(masm, &stack_overflow); 1751 ArgumentAdaptorStackCheck(masm, &stack_overflow);
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1891 } 1891 }
1892 } 1892 }
1893 1893
1894 1894
1895 #undef __ 1895 #undef __
1896 1896
1897 } // namespace internal 1897 } // namespace internal
1898 } // namespace v8 1898 } // namespace v8
1899 1899
1900 #endif // V8_TARGET_ARCH_MIPS 1900 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/interpreter/interpreter.cc ('k') | src/mips/code-stubs-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698