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

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

Issue 196133017: Experimental parser: merge r19949 (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/parser
Patch Set: Created 6 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « src/mips/assembler-mips-inl.h ('k') | src/mips/code-stubs-mips.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 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 __ SmiTst(a2, t0); 156 __ SmiTst(a2, t0);
157 __ Assert(ne, kUnexpectedInitialMapForArrayFunction1, 157 __ Assert(ne, kUnexpectedInitialMapForArrayFunction1,
158 t0, Operand(zero_reg)); 158 t0, Operand(zero_reg));
159 __ GetObjectType(a2, a3, t0); 159 __ GetObjectType(a2, a3, t0);
160 __ Assert(eq, kUnexpectedInitialMapForArrayFunction2, 160 __ Assert(eq, kUnexpectedInitialMapForArrayFunction2,
161 t0, Operand(MAP_TYPE)); 161 t0, Operand(MAP_TYPE));
162 } 162 }
163 163
164 // Run the native code for the Array function called as a normal function. 164 // Run the native code for the Array function called as a normal function.
165 // Tail call a stub. 165 // Tail call a stub.
166 Handle<Object> undefined_sentinel( 166 Handle<Object> megamorphic_sentinel =
167 masm->isolate()->heap()->undefined_value(), 167 TypeFeedbackInfo::MegamorphicSentinel(masm->isolate());
168 masm->isolate()); 168 __ li(a2, Operand(megamorphic_sentinel));
169 __ li(a2, Operand(undefined_sentinel));
170 ArrayConstructorStub stub(masm->isolate()); 169 ArrayConstructorStub stub(masm->isolate());
171 __ TailCallStub(&stub); 170 __ TailCallStub(&stub);
172 } 171 }
173 172
174 173
175 void Builtins::Generate_StringConstructCode(MacroAssembler* masm) { 174 void Builtins::Generate_StringConstructCode(MacroAssembler* masm) {
176 // ----------- S t a t e ------------- 175 // ----------- S t a t e -------------
177 // -- a0 : number of arguments 176 // -- a0 : number of arguments
178 // -- a1 : constructor function 177 // -- a1 : constructor function
179 // -- ra : return address 178 // -- ra : return address
(...skipping 570 matching lines...) Expand 10 before | Expand all | Expand 10 after
750 __ mov(s3, t0); 749 __ mov(s3, t0);
751 __ mov(s4, t0); 750 __ mov(s4, t0);
752 __ mov(s5, t0); 751 __ mov(s5, t0);
753 // s6 holds the root address. Do not clobber. 752 // s6 holds the root address. Do not clobber.
754 // s7 is cp. Do not init. 753 // s7 is cp. Do not init.
755 754
756 // Invoke the code and pass argc as a0. 755 // Invoke the code and pass argc as a0.
757 __ mov(a0, a3); 756 __ mov(a0, a3);
758 if (is_construct) { 757 if (is_construct) {
759 // No type feedback cell is available 758 // No type feedback cell is available
760 Handle<Object> undefined_sentinel( 759 Handle<Object> megamorphic_sentinel =
761 masm->isolate()->heap()->undefined_value(), masm->isolate()); 760 TypeFeedbackInfo::MegamorphicSentinel(masm->isolate());
762 __ li(a2, Operand(undefined_sentinel)); 761 __ li(a2, Operand(megamorphic_sentinel));
763 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS); 762 CallConstructStub stub(NO_CALL_FUNCTION_FLAGS);
764 __ CallStub(&stub); 763 __ CallStub(&stub);
765 } else { 764 } else {
766 ParameterCount actual(a0); 765 ParameterCount actual(a0);
767 __ InvokeFunction(a1, actual, CALL_FUNCTION, NullCallWrapper()); 766 __ InvokeFunction(a1, actual, CALL_FUNCTION, NullCallWrapper());
768 } 767 }
769 768
770 // Leave internal frame. 769 // Leave internal frame.
771 } 770 }
772 771
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1060 __ lw(a2, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset)); 1059 __ lw(a2, FieldMemOperand(a1, JSFunction::kSharedFunctionInfoOffset));
1061 __ lw(a3, FieldMemOperand(a2, SharedFunctionInfo::kCompilerHintsOffset)); 1060 __ lw(a3, FieldMemOperand(a2, SharedFunctionInfo::kCompilerHintsOffset));
1062 __ And(t3, a3, Operand(1 << (SharedFunctionInfo::kStrictModeFunction + 1061 __ And(t3, a3, Operand(1 << (SharedFunctionInfo::kStrictModeFunction +
1063 kSmiTagSize))); 1062 kSmiTagSize)));
1064 __ Branch(&shift_arguments, ne, t3, Operand(zero_reg)); 1063 __ Branch(&shift_arguments, ne, t3, Operand(zero_reg));
1065 1064
1066 // Do not transform the receiver for native (Compilerhints already in a3). 1065 // Do not transform the receiver for native (Compilerhints already in a3).
1067 __ And(t3, a3, Operand(1 << (SharedFunctionInfo::kNative + kSmiTagSize))); 1066 __ And(t3, a3, Operand(1 << (SharedFunctionInfo::kNative + kSmiTagSize)));
1068 __ Branch(&shift_arguments, ne, t3, Operand(zero_reg)); 1067 __ Branch(&shift_arguments, ne, t3, Operand(zero_reg));
1069 1068
1070 // Compute the receiver in non-strict mode. 1069 // Compute the receiver in sloppy mode.
1071 // Load first argument in a2. a2 = -kPointerSize(sp + n_args << 2). 1070 // Load first argument in a2. a2 = -kPointerSize(sp + n_args << 2).
1072 __ sll(at, a0, kPointerSizeLog2); 1071 __ sll(at, a0, kPointerSizeLog2);
1073 __ addu(a2, sp, at); 1072 __ addu(a2, sp, at);
1074 __ lw(a2, MemOperand(a2, -kPointerSize)); 1073 __ lw(a2, MemOperand(a2, -kPointerSize));
1075 // a0: actual number of arguments 1074 // a0: actual number of arguments
1076 // a1: function 1075 // a1: function
1077 // a2: first argument 1076 // a2: first argument
1078 __ JumpIfSmi(a2, &convert_to_object, t2); 1077 __ JumpIfSmi(a2, &convert_to_object, t2);
1079 1078
1080 __ LoadRoot(a3, Heap::kUndefinedValueRootIndex); 1079 __ LoadRoot(a3, Heap::kUndefinedValueRootIndex);
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
1263 Label call_to_object, use_global_receiver; 1262 Label call_to_object, use_global_receiver;
1264 __ lw(a2, FieldMemOperand(a2, SharedFunctionInfo::kCompilerHintsOffset)); 1263 __ lw(a2, FieldMemOperand(a2, SharedFunctionInfo::kCompilerHintsOffset));
1265 __ And(t3, a2, Operand(1 << (SharedFunctionInfo::kStrictModeFunction + 1264 __ And(t3, a2, Operand(1 << (SharedFunctionInfo::kStrictModeFunction +
1266 kSmiTagSize))); 1265 kSmiTagSize)));
1267 __ Branch(&push_receiver, ne, t3, Operand(zero_reg)); 1266 __ Branch(&push_receiver, ne, t3, Operand(zero_reg));
1268 1267
1269 // Do not transform the receiver for native (Compilerhints already in a2). 1268 // Do not transform the receiver for native (Compilerhints already in a2).
1270 __ And(t3, a2, Operand(1 << (SharedFunctionInfo::kNative + kSmiTagSize))); 1269 __ And(t3, a2, Operand(1 << (SharedFunctionInfo::kNative + kSmiTagSize)));
1271 __ Branch(&push_receiver, ne, t3, Operand(zero_reg)); 1270 __ Branch(&push_receiver, ne, t3, Operand(zero_reg));
1272 1271
1273 // Compute the receiver in non-strict mode. 1272 // Compute the receiver in sloppy mode.
1274 __ JumpIfSmi(a0, &call_to_object); 1273 __ JumpIfSmi(a0, &call_to_object);
1275 __ LoadRoot(a1, Heap::kNullValueRootIndex); 1274 __ LoadRoot(a1, Heap::kNullValueRootIndex);
1276 __ Branch(&use_global_receiver, eq, a0, Operand(a1)); 1275 __ Branch(&use_global_receiver, eq, a0, Operand(a1));
1277 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex); 1276 __ LoadRoot(a2, Heap::kUndefinedValueRootIndex);
1278 __ Branch(&use_global_receiver, eq, a0, Operand(a2)); 1277 __ Branch(&use_global_receiver, eq, a0, Operand(a2));
1279 1278
1280 // Check if the receiver is already a JavaScript object. 1279 // Check if the receiver is already a JavaScript object.
1281 // a0: receiver 1280 // a0: receiver
1282 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE); 1281 STATIC_ASSERT(LAST_SPEC_OBJECT_TYPE == LAST_TYPE);
1283 __ GetObjectType(a0, a1, a1); 1282 __ GetObjectType(a0, a1, a1);
(...skipping 216 matching lines...) Expand 10 before | Expand all | Expand 10 after
1500 __ bind(&dont_adapt_arguments); 1499 __ bind(&dont_adapt_arguments);
1501 __ Jump(a3); 1500 __ Jump(a3);
1502 } 1501 }
1503 1502
1504 1503
1505 #undef __ 1504 #undef __
1506 1505
1507 } } // namespace v8::internal 1506 } } // namespace v8::internal
1508 1507
1509 #endif // V8_TARGET_ARCH_MIPS 1508 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « src/mips/assembler-mips-inl.h ('k') | src/mips/code-stubs-mips.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698