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

Side by Side Diff: src/mips/code-stubs-mips.cc

Issue 197463009: MIPS: Turn StringLengthStub (used by string wrappers only) into a hydrogen stub. (Closed) Base URL: https://github.com/v8/v8.git@gbl
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
« no previous file with comments | « no previous file | src/mips/stub-cache-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 // 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 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
159 void KeyedLoadFieldStub::InitializeInterfaceDescriptor( 159 void KeyedLoadFieldStub::InitializeInterfaceDescriptor(
160 Isolate* isolate, 160 Isolate* isolate,
161 CodeStubInterfaceDescriptor* descriptor) { 161 CodeStubInterfaceDescriptor* descriptor) {
162 static Register registers[] = { a1 }; 162 static Register registers[] = { a1 };
163 descriptor->register_param_count_ = 1; 163 descriptor->register_param_count_ = 1;
164 descriptor->register_params_ = registers; 164 descriptor->register_params_ = registers;
165 descriptor->deoptimization_handler_ = NULL; 165 descriptor->deoptimization_handler_ = NULL;
166 } 166 }
167 167
168 168
169 void StringLengthStub::InitializeInterfaceDescriptor(
170 Isolate* isolate,
171 CodeStubInterfaceDescriptor* descriptor) {
172 static Register registers[] = { a0, a2 };
173 descriptor->register_param_count_ = 2;
174 descriptor->register_params_ = registers;
175 descriptor->deoptimization_handler_ = NULL;
176 }
177
178
179 void KeyedStringLengthStub::InitializeInterfaceDescriptor(
180 Isolate* isolate,
181 CodeStubInterfaceDescriptor* descriptor) {
182 static Register registers[] = { a1, a0 };
183 descriptor->register_param_count_ = 2;
184 descriptor->register_params_ = registers;
185 descriptor->deoptimization_handler_ = NULL;
186 }
187
188
169 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor( 189 void KeyedStoreFastElementStub::InitializeInterfaceDescriptor(
170 Isolate* isolate, 190 Isolate* isolate,
171 CodeStubInterfaceDescriptor* descriptor) { 191 CodeStubInterfaceDescriptor* descriptor) {
172 static Register registers[] = { a2, a1, a0 }; 192 static Register registers[] = { a2, a1, a0 };
173 descriptor->register_param_count_ = 3; 193 descriptor->register_param_count_ = 3;
174 descriptor->register_params_ = registers; 194 descriptor->register_params_ = registers;
175 descriptor->deoptimization_handler_ = 195 descriptor->deoptimization_handler_ =
176 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure); 196 FUNCTION_ADDR(KeyedStoreIC_MissFromStubFailure);
177 } 197 }
178 198
(...skipping 2018 matching lines...) Expand 10 before | Expand all | Expand 10 after
2197 receiver = a0; 2217 receiver = a0;
2198 } 2218 }
2199 2219
2200 StubCompiler::GenerateLoadFunctionPrototype(masm, receiver, a3, t0, &miss); 2220 StubCompiler::GenerateLoadFunctionPrototype(masm, receiver, a3, t0, &miss);
2201 __ bind(&miss); 2221 __ bind(&miss);
2202 StubCompiler::TailCallBuiltin( 2222 StubCompiler::TailCallBuiltin(
2203 masm, BaseLoadStoreStubCompiler::MissBuiltin(kind())); 2223 masm, BaseLoadStoreStubCompiler::MissBuiltin(kind()));
2204 } 2224 }
2205 2225
2206 2226
2207 void StringLengthStub::Generate(MacroAssembler* masm) {
2208 Label miss;
2209 Register receiver;
2210 if (kind() == Code::KEYED_LOAD_IC) {
2211 // ----------- S t a t e -------------
2212 // -- ra : return address
2213 // -- a0 : key
2214 // -- a1 : receiver
2215 // -----------------------------------
2216 __ Branch(&miss, ne, a0,
2217 Operand(masm->isolate()->factory()->length_string()));
2218 receiver = a1;
2219 } else {
2220 ASSERT(kind() == Code::LOAD_IC);
2221 // ----------- S t a t e -------------
2222 // -- a2 : name
2223 // -- ra : return address
2224 // -- a0 : receiver
2225 // -- sp[0] : receiver
2226 // -----------------------------------
2227 receiver = a0;
2228 }
2229
2230 StubCompiler::GenerateLoadStringLength(masm, receiver, a3, t0, &miss);
2231
2232 __ bind(&miss);
2233 StubCompiler::TailCallBuiltin(
2234 masm, BaseLoadStoreStubCompiler::MissBuiltin(kind()));
2235 }
2236
2237
2238 void StoreArrayLengthStub::Generate(MacroAssembler* masm) { 2227 void StoreArrayLengthStub::Generate(MacroAssembler* masm) {
2239 // This accepts as a receiver anything JSArray::SetElementsLength accepts 2228 // This accepts as a receiver anything JSArray::SetElementsLength accepts
2240 // (currently anything except for external arrays which means anything with 2229 // (currently anything except for external arrays which means anything with
2241 // elements of FixedArray type). Value must be a number, but only smis are 2230 // elements of FixedArray type). Value must be a number, but only smis are
2242 // accepted as the most common case. 2231 // accepted as the most common case.
2243 Label miss; 2232 Label miss;
2244 2233
2245 Register receiver; 2234 Register receiver;
2246 Register value; 2235 Register value;
2247 if (kind() == Code::KEYED_STORE_IC) { 2236 if (kind() == Code::KEYED_STORE_IC) {
(...skipping 3510 matching lines...) Expand 10 before | Expand all | Expand 10 after
5758 MemOperand(fp, 6 * kPointerSize), 5747 MemOperand(fp, 6 * kPointerSize),
5759 NULL); 5748 NULL);
5760 } 5749 }
5761 5750
5762 5751
5763 #undef __ 5752 #undef __
5764 5753
5765 } } // namespace v8::internal 5754 } } // namespace v8::internal
5766 5755
5767 #endif // V8_TARGET_ARCH_MIPS 5756 #endif // V8_TARGET_ARCH_MIPS
OLDNEW
« no previous file with comments | « no previous file | src/mips/stub-cache-mips.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698