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

Side by Side Diff: src/arm/stub-cache-arm.cc

Issue 9323004: ARM: More micro-optimization of megamorphic lookup. (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 8 years, 10 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 | « no previous file | no next file » | 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 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 __ JumpIfSmi(receiver, &miss); 198 __ JumpIfSmi(receiver, &miss);
199 199
200 // Get the map of the receiver and compute the hash. 200 // Get the map of the receiver and compute the hash.
201 __ ldr(scratch, FieldMemOperand(name, String::kHashFieldOffset)); 201 __ ldr(scratch, FieldMemOperand(name, String::kHashFieldOffset));
202 __ ldr(ip, FieldMemOperand(receiver, HeapObject::kMapOffset)); 202 __ ldr(ip, FieldMemOperand(receiver, HeapObject::kMapOffset));
203 __ add(scratch, scratch, Operand(ip)); 203 __ add(scratch, scratch, Operand(ip));
204 uint32_t mask = (kPrimaryTableSize - 1) << kHeapObjectTagSize; 204 uint32_t mask = (kPrimaryTableSize - 1) << kHeapObjectTagSize;
205 // Mask down the eor argument to the minimum to keep the immediate 205 // Mask down the eor argument to the minimum to keep the immediate
206 // ARM-encodable. 206 // ARM-encodable.
207 __ eor(scratch, scratch, Operand(flags & mask)); 207 __ eor(scratch, scratch, Operand(flags & mask));
208 // Prefer ubfx to and_ here because the mask is not ARM-encodable. 208 // Prefer and_ to ubfx here because ubfx takes 2 cycles.
209 __ Ubfx(scratch, scratch, kHeapObjectTagSize, kPrimaryTableBits); 209 __ and_(scratch, scratch, Operand(mask));
210 __ mov(scratch, Operand(scratch, LSR, 1));
210 211
211 // Probe the primary table. 212 // Probe the primary table.
212 ProbeTable(isolate, 213 ProbeTable(isolate,
213 masm, 214 masm,
214 flags, 215 flags,
215 kPrimary, 216 kPrimary,
216 name, 217 name,
217 scratch, 218 scratch,
218 kHeapObjectTagSize, 219 1,
219 extra, 220 extra,
220 extra2); 221 extra2);
221 222
222 // Primary miss: Compute hash for secondary probe. 223 // Primary miss: Compute hash for secondary probe.
223 __ rsb(scratch, name, Operand(scratch, LSL, kHeapObjectTagSize)); 224 __ sub(scratch, scratch, Operand(name, LSR, 1));
224 __ add(scratch, scratch, Operand(flags)); 225 uint32_t mask2 = (kSecondaryTableSize - 1) << (kHeapObjectTagSize - 1);
225 __ Ubfx(scratch, scratch, kHeapObjectTagSize, kSecondaryTableBits); 226 __ add(scratch, scratch, Operand((flags >> 1) & mask2));
227 __ and_(scratch, scratch, Operand(mask2));
226 228
227 // Probe the secondary table. 229 // Probe the secondary table.
228 ProbeTable(isolate, 230 ProbeTable(isolate,
229 masm, 231 masm,
230 flags, 232 flags,
231 kSecondary, 233 kSecondary,
232 name, 234 name,
233 scratch, 235 scratch,
234 kHeapObjectTagSize, 236 1,
235 extra, 237 extra,
236 extra2); 238 extra2);
237 239
238 // Cache miss: Fall-through and let caller handle the miss by 240 // Cache miss: Fall-through and let caller handle the miss by
239 // entering the runtime system. 241 // entering the runtime system.
240 __ bind(&miss); 242 __ bind(&miss);
241 } 243 }
242 244
243 245
244 void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, 246 void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm,
(...skipping 3999 matching lines...) Expand 10 before | Expand all | Expand 10 after
4244 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss(); 4246 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss();
4245 __ Jump(ic_miss, RelocInfo::CODE_TARGET); 4247 __ Jump(ic_miss, RelocInfo::CODE_TARGET);
4246 } 4248 }
4247 4249
4248 4250
4249 #undef __ 4251 #undef __
4250 4252
4251 } } // namespace v8::internal 4253 } } // namespace v8::internal
4252 4254
4253 #endif // V8_TARGET_ARCH_ARM 4255 #endif // V8_TARGET_ARCH_ARM
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698