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

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.
Michael Starzinger 2012/02/02 15:36:08 Can the following sequence be rewritten like follo
223 __ rsb(scratch, name, Operand(scratch, LSL, kHeapObjectTagSize)); 224 __ rsb(scratch, name, Operand(scratch, LSL, 1));
224 __ add(scratch, scratch, Operand(flags)); 225 __ add(scratch, scratch, Operand(flags));
225 __ Ubfx(scratch, scratch, kHeapObjectTagSize, kSecondaryTableBits); 226 __ and_(scratch,
227 scratch,
228 Operand((kSecondaryTableSize - 1) << kHeapObjectTagSize));
229 __ mov(scratch, Operand(scratch, LSR, 1));
226 230
227 // Probe the secondary table. 231 // Probe the secondary table.
228 ProbeTable(isolate, 232 ProbeTable(isolate,
229 masm, 233 masm,
230 flags, 234 flags,
231 kSecondary, 235 kSecondary,
232 name, 236 name,
233 scratch, 237 scratch,
234 kHeapObjectTagSize, 238 1,
235 extra, 239 extra,
236 extra2); 240 extra2);
237 241
238 // Cache miss: Fall-through and let caller handle the miss by 242 // Cache miss: Fall-through and let caller handle the miss by
239 // entering the runtime system. 243 // entering the runtime system.
240 __ bind(&miss); 244 __ bind(&miss);
241 } 245 }
242 246
243 247
244 void StubCompiler::GenerateLoadGlobalFunctionPrototype(MacroAssembler* masm, 248 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(); 4248 Handle<Code> ic_miss = masm->isolate()->builtins()->KeyedStoreIC_Miss();
4245 __ Jump(ic_miss, RelocInfo::CODE_TARGET); 4249 __ Jump(ic_miss, RelocInfo::CODE_TARGET);
4246 } 4250 }
4247 4251
4248 4252
4249 #undef __ 4253 #undef __
4250 4254
4251 } } // namespace v8::internal 4255 } } // namespace v8::internal
4252 4256
4253 #endif // V8_TARGET_ARCH_ARM 4257 #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