OLD | NEW |
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_IA32 | 7 #if V8_TARGET_ARCH_IA32 |
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 Loading... |
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 1265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1499 // ----------------------------------- | 1499 // ----------------------------------- |
1500 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1500 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
1501 } | 1501 } |
1502 | 1502 |
1503 | 1503 |
1504 #undef __ | 1504 #undef __ |
1505 | 1505 |
1506 } } // namespace v8::internal | 1506 } } // namespace v8::internal |
1507 | 1507 |
1508 #endif // V8_TARGET_ARCH_IA32 | 1508 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |