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

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

Issue 401613003: Unravel kHeapObjectTagSize from the stub cache. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 6 years, 5 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/x64/stub-cache-x64.cc ('k') | 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 // 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 #include "src/v8.h" 5 #include "src/v8.h"
6 6
7 #if V8_TARGET_ARCH_X87 7 #if V8_TARGET_ARCH_X87
8 8
9 #include "src/codegen.h" 9 #include "src/codegen.h"
10 #include "src/ic-inl.h" 10 #include "src/ic-inl.h"
(...skipping 187 matching lines...) Expand 10 before | Expand all | Expand 10 after
198 198
199 // Check that the receiver isn't a smi. 199 // Check that the receiver isn't a smi.
200 __ JumpIfSmi(receiver, &miss); 200 __ JumpIfSmi(receiver, &miss);
201 201
202 // Get the map of the receiver and compute the hash. 202 // Get the map of the receiver and compute the hash.
203 __ mov(offset, FieldOperand(name, Name::kHashFieldOffset)); 203 __ mov(offset, FieldOperand(name, Name::kHashFieldOffset));
204 __ add(offset, FieldOperand(receiver, HeapObject::kMapOffset)); 204 __ add(offset, FieldOperand(receiver, HeapObject::kMapOffset));
205 __ xor_(offset, flags); 205 __ xor_(offset, flags);
206 // We mask out the last two bits because they are not part of the hash and 206 // We mask out the last two bits because they are not part of the hash and
207 // they are always 01 for maps. Also in the two 'and' instructions below. 207 // they are always 01 for maps. Also in the two 'and' instructions below.
208 __ and_(offset, (kPrimaryTableSize - 1) << kHeapObjectTagSize); 208 __ and_(offset, (kPrimaryTableSize - 1) << kCacheIndexShift);
209 // ProbeTable expects the offset to be pointer scaled, which it is, because 209 // ProbeTable expects the offset to be pointer scaled, which it is, because
210 // the heap object tag size is 2 and the pointer size log 2 is also 2. 210 // the heap object tag size is 2 and the pointer size log 2 is also 2.
211 ASSERT(kHeapObjectTagSize == kPointerSizeLog2); 211 ASSERT(kCacheIndexShift == kPointerSizeLog2);
212 212
213 // Probe the primary table. 213 // Probe the primary table.
214 ProbeTable(isolate(), masm, flags, kPrimary, name, receiver, offset, extra); 214 ProbeTable(isolate(), masm, flags, kPrimary, name, receiver, offset, extra);
215 215
216 // Primary miss: Compute hash for secondary probe. 216 // Primary miss: Compute hash for secondary probe.
217 __ mov(offset, FieldOperand(name, Name::kHashFieldOffset)); 217 __ mov(offset, FieldOperand(name, Name::kHashFieldOffset));
218 __ add(offset, FieldOperand(receiver, HeapObject::kMapOffset)); 218 __ add(offset, FieldOperand(receiver, HeapObject::kMapOffset));
219 __ xor_(offset, flags); 219 __ xor_(offset, flags);
220 __ and_(offset, (kPrimaryTableSize - 1) << kHeapObjectTagSize); 220 __ and_(offset, (kPrimaryTableSize - 1) << kCacheIndexShift);
221 __ sub(offset, name); 221 __ sub(offset, name);
222 __ add(offset, Immediate(flags)); 222 __ add(offset, Immediate(flags));
223 __ and_(offset, (kSecondaryTableSize - 1) << kHeapObjectTagSize); 223 __ and_(offset, (kSecondaryTableSize - 1) << kCacheIndexShift);
224 224
225 // Probe the secondary table. 225 // Probe the secondary table.
226 ProbeTable( 226 ProbeTable(
227 isolate(), masm, flags, kSecondary, name, receiver, offset, extra); 227 isolate(), masm, flags, kSecondary, name, receiver, offset, extra);
228 228
229 // Cache miss: Fall-through and let caller handle the miss by 229 // Cache miss: Fall-through and let caller handle the miss by
230 // entering the runtime system. 230 // entering the runtime system.
231 __ bind(&miss); 231 __ bind(&miss);
232 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1); 232 __ IncrementCounter(counters->megamorphic_stub_cache_misses(), 1);
233 } 233 }
(...skipping 1264 matching lines...) Expand 10 before | Expand all | Expand 10 after
1498 // ----------------------------------- 1498 // -----------------------------------
1499 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); 1499 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss);
1500 } 1500 }
1501 1501
1502 1502
1503 #undef __ 1503 #undef __
1504 1504
1505 } } // namespace v8::internal 1505 } } // namespace v8::internal
1506 1506
1507 #endif // V8_TARGET_ARCH_X87 1507 #endif // V8_TARGET_ARCH_X87
OLDNEW
« no previous file with comments | « src/x64/stub-cache-x64.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698