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_ARM | 7 #if V8_TARGET_ARCH_ARM |
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 184 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 // Check that the receiver isn't a smi. | 195 // Check that the receiver isn't a smi. |
196 __ JumpIfSmi(receiver, &miss); | 196 __ JumpIfSmi(receiver, &miss); |
197 | 197 |
198 // Get the map of the receiver and compute the hash. | 198 // Get the map of the receiver and compute the hash. |
199 __ ldr(scratch, FieldMemOperand(name, Name::kHashFieldOffset)); | 199 __ ldr(scratch, FieldMemOperand(name, Name::kHashFieldOffset)); |
200 __ ldr(ip, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 200 __ ldr(ip, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
201 __ add(scratch, scratch, Operand(ip)); | 201 __ add(scratch, scratch, Operand(ip)); |
202 uint32_t mask = kPrimaryTableSize - 1; | 202 uint32_t mask = kPrimaryTableSize - 1; |
203 // We shift out the last two bits because they are not part of the hash and | 203 // We shift out the last two bits because they are not part of the hash and |
204 // they are always 01 for maps. | 204 // they are always 01 for maps. |
205 __ mov(scratch, Operand(scratch, LSR, kHeapObjectTagSize)); | 205 __ mov(scratch, Operand(scratch, LSR, kCacheIndexShift)); |
206 // Mask down the eor argument to the minimum to keep the immediate | 206 // Mask down the eor argument to the minimum to keep the immediate |
207 // ARM-encodable. | 207 // ARM-encodable. |
208 __ eor(scratch, scratch, Operand((flags >> kHeapObjectTagSize) & mask)); | 208 __ eor(scratch, scratch, Operand((flags >> kCacheIndexShift) & mask)); |
209 // Prefer and_ to ubfx here because ubfx takes 2 cycles. | 209 // Prefer and_ to ubfx here because ubfx takes 2 cycles. |
210 __ and_(scratch, scratch, Operand(mask)); | 210 __ and_(scratch, scratch, Operand(mask)); |
211 | 211 |
212 // Probe the primary table. | 212 // Probe the primary table. |
213 ProbeTable(isolate, | 213 ProbeTable(isolate, |
214 masm, | 214 masm, |
215 flags, | 215 flags, |
216 kPrimary, | 216 kPrimary, |
217 receiver, | 217 receiver, |
218 name, | 218 name, |
219 scratch, | 219 scratch, |
220 extra, | 220 extra, |
221 extra2, | 221 extra2, |
222 extra3); | 222 extra3); |
223 | 223 |
224 // Primary miss: Compute hash for secondary probe. | 224 // Primary miss: Compute hash for secondary probe. |
225 __ sub(scratch, scratch, Operand(name, LSR, kHeapObjectTagSize)); | 225 __ sub(scratch, scratch, Operand(name, LSR, kCacheIndexShift)); |
226 uint32_t mask2 = kSecondaryTableSize - 1; | 226 uint32_t mask2 = kSecondaryTableSize - 1; |
227 __ add(scratch, scratch, Operand((flags >> kHeapObjectTagSize) & mask2)); | 227 __ add(scratch, scratch, Operand((flags >> kCacheIndexShift) & mask2)); |
228 __ and_(scratch, scratch, Operand(mask2)); | 228 __ and_(scratch, scratch, Operand(mask2)); |
229 | 229 |
230 // Probe the secondary table. | 230 // Probe the secondary table. |
231 ProbeTable(isolate, | 231 ProbeTable(isolate, |
232 masm, | 232 masm, |
233 flags, | 233 flags, |
234 kSecondary, | 234 kSecondary, |
235 receiver, | 235 receiver, |
236 name, | 236 name, |
237 scratch, | 237 scratch, |
(...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1506 | 1506 |
1507 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); | 1507 TailCallBuiltin(masm, Builtins::kKeyedLoadIC_Miss); |
1508 } | 1508 } |
1509 | 1509 |
1510 | 1510 |
1511 #undef __ | 1511 #undef __ |
1512 | 1512 |
1513 } } // namespace v8::internal | 1513 } } // namespace v8::internal |
1514 | 1514 |
1515 #endif // V8_TARGET_ARCH_ARM | 1515 #endif // V8_TARGET_ARCH_ARM |
OLD | NEW |