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

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

Issue 1402943002: [Interpreter] Support for operator new. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix missing receiver slot. 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/interface-descriptors-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 968 matching lines...) Expand 10 before | Expand all | Expand 10 after
979 979
980 980
981 // static 981 // static
982 void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) { 982 void Builtins::Generate_InterpreterPushArgsAndCall(MacroAssembler* masm) {
983 // ----------- S t a t e ------------- 983 // ----------- S t a t e -------------
984 // -- a0 : the number of arguments (not including the receiver) 984 // -- a0 : the number of arguments (not including the receiver)
985 // -- a2 : the address of the first argument to be pushed. Subsequent 985 // -- a2 : the address of the first argument to be pushed. Subsequent
986 // arguments should be consecutive above this, in the same order as 986 // arguments should be consecutive above this, in the same order as
987 // they are to be pushed onto the stack. 987 // they are to be pushed onto the stack.
988 // -- a1 : the target to call (can be any Object). 988 // -- a1 : the target to call (can be any Object).
989 // -----------------------------------
989 990
990 // Find the address of the last argument. 991 // Find the address of the last argument.
991 __ Addu(a3, a0, Operand(1)); // Add one for receiver. 992 __ Addu(a3, a0, Operand(1)); // Add one for receiver.
992 __ sll(a3, a3, kPointerSizeLog2); 993 __ sll(a3, a3, kPointerSizeLog2);
993 __ Subu(a3, a2, Operand(a3)); 994 __ Subu(a3, a2, Operand(a3));
994 995
995 // Push the arguments. 996 // Push the arguments.
996 Label loop_header, loop_check; 997 Label loop_header, loop_check;
997 __ Branch(&loop_check); 998 __ Branch(&loop_check);
998 __ bind(&loop_header); 999 __ bind(&loop_header);
999 __ lw(t0, MemOperand(a2)); 1000 __ lw(t0, MemOperand(a2));
1000 __ Addu(a2, a2, Operand(-kPointerSize)); 1001 __ Addu(a2, a2, Operand(-kPointerSize));
1001 __ push(t0); 1002 __ push(t0);
1002 __ bind(&loop_check); 1003 __ bind(&loop_check);
1003 __ Branch(&loop_header, gt, a2, Operand(a3)); 1004 __ Branch(&loop_header, gt, a2, Operand(a3));
1004 1005
1005 // Call the target. 1006 // Call the target.
1006 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET); 1007 __ Jump(masm->isolate()->builtins()->Call(), RelocInfo::CODE_TARGET);
1007 } 1008 }
1008 1009
1009 1010
1011 // static
1012 void Builtins::Generate_InterpreterPushArgsAndConstruct(MacroAssembler* masm) {
1013 // ----------- S t a t e -------------
1014 // -- a0 : argument count (not including receiver)
1015 // -- a3 : original constructor
1016 // -- a1 : constructor to call
1017 // -- a2 : address of the first argument
1018 // -----------------------------------
1019
1020 // Find the address of the last argument.
1021 __ sll(t0, a0, kPointerSizeLog2);
1022 __ Subu(t0, a2, Operand(t0));
1023
1024 // Push a slot for the receiver.
1025 __ push(zero_reg);
1026
1027 // Push the arguments.
1028 Label loop_header, loop_check;
1029 __ Branch(&loop_check);
1030 __ bind(&loop_header);
1031 __ lw(t1, MemOperand(a2));
1032 __ Addu(a2, a2, Operand(-kPointerSize));
1033 __ push(t1);
1034 __ bind(&loop_check);
1035 __ Branch(&loop_header, gt, a2, Operand(t0));
1036
1037 // Call the constructor with a0, a1, and a3 unmodified.
1038 __ Jump(masm->isolate()->builtins()->Construct(), RelocInfo::CONSTRUCT_CALL);
1039 }
1040
1041
1010 void Builtins::Generate_CompileLazy(MacroAssembler* masm) { 1042 void Builtins::Generate_CompileLazy(MacroAssembler* masm) {
1011 CallRuntimePassFunction(masm, Runtime::kCompileLazy); 1043 CallRuntimePassFunction(masm, Runtime::kCompileLazy);
1012 GenerateTailCallToReturnedCode(masm); 1044 GenerateTailCallToReturnedCode(masm);
1013 } 1045 }
1014 1046
1015 1047
1016 static void CallCompileOptimized(MacroAssembler* masm, bool concurrent) { 1048 static void CallCompileOptimized(MacroAssembler* masm, bool concurrent) {
1017 FrameScope scope(masm, StackFrame::INTERNAL); 1049 FrameScope scope(masm, StackFrame::INTERNAL);
1018 // Push a copy of the function onto the stack. 1050 // Push a copy of the function onto the stack.
1019 // Push function as parameter to the runtime call. 1051 // Push function as parameter to the runtime call.
(...skipping 886 matching lines...) Expand 10 before | Expand all | Expand 10 after
1906 } 1938 }
1907 } 1939 }
1908 1940
1909 1941
1910 #undef __ 1942 #undef __
1911 1943
1912 } // namespace internal 1944 } // namespace internal
1913 } // namespace v8 1945 } // namespace v8
1914 1946
1915 #endif // V8_TARGET_ARCH_MIPS 1947 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/interpreter/interpreter.cc ('k') | src/mips/interface-descriptors-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698