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_MIPS | 7 #if V8_TARGET_ARCH_MIPS |
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 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 // Check that the receiver isn't a smi. | 189 // Check that the receiver isn't a smi. |
190 __ JumpIfSmi(receiver, &miss); | 190 __ JumpIfSmi(receiver, &miss); |
191 | 191 |
192 // Get the map of the receiver and compute the hash. | 192 // Get the map of the receiver and compute the hash. |
193 __ lw(scratch, FieldMemOperand(name, Name::kHashFieldOffset)); | 193 __ lw(scratch, FieldMemOperand(name, Name::kHashFieldOffset)); |
194 __ lw(at, FieldMemOperand(receiver, HeapObject::kMapOffset)); | 194 __ lw(at, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
195 __ Addu(scratch, scratch, at); | 195 __ Addu(scratch, scratch, at); |
196 uint32_t mask = kPrimaryTableSize - 1; | 196 uint32_t mask = kPrimaryTableSize - 1; |
197 // We shift out the last two bits because they are not part of the hash and | 197 // We shift out the last two bits because they are not part of the hash and |
198 // they are always 01 for maps. | 198 // they are always 01 for maps. |
199 __ srl(scratch, scratch, kHeapObjectTagSize); | 199 __ srl(scratch, scratch, kCacheIndexShift); |
200 __ Xor(scratch, scratch, Operand((flags >> kHeapObjectTagSize) & mask)); | 200 __ Xor(scratch, scratch, Operand((flags >> kCacheIndexShift) & mask)); |
201 __ And(scratch, scratch, Operand(mask)); | 201 __ And(scratch, scratch, Operand(mask)); |
202 | 202 |
203 // Probe the primary table. | 203 // Probe the primary table. |
204 ProbeTable(isolate, | 204 ProbeTable(isolate, |
205 masm, | 205 masm, |
206 flags, | 206 flags, |
207 kPrimary, | 207 kPrimary, |
208 receiver, | 208 receiver, |
209 name, | 209 name, |
210 scratch, | 210 scratch, |
211 extra, | 211 extra, |
212 extra2, | 212 extra2, |
213 extra3); | 213 extra3); |
214 | 214 |
215 // Primary miss: Compute hash for secondary probe. | 215 // Primary miss: Compute hash for secondary probe. |
216 __ srl(at, name, kHeapObjectTagSize); | 216 __ srl(at, name, kCacheIndexShift); |
217 __ Subu(scratch, scratch, at); | 217 __ Subu(scratch, scratch, at); |
218 uint32_t mask2 = kSecondaryTableSize - 1; | 218 uint32_t mask2 = kSecondaryTableSize - 1; |
219 __ Addu(scratch, scratch, Operand((flags >> kHeapObjectTagSize) & mask2)); | 219 __ Addu(scratch, scratch, Operand((flags >> kCacheIndexShift) & mask2)); |
220 __ And(scratch, scratch, Operand(mask2)); | 220 __ And(scratch, scratch, Operand(mask2)); |
221 | 221 |
222 // Probe the secondary table. | 222 // Probe the secondary table. |
223 ProbeTable(isolate, | 223 ProbeTable(isolate, |
224 masm, | 224 masm, |
225 flags, | 225 flags, |
226 kSecondary, | 226 kSecondary, |
227 receiver, | 227 receiver, |
228 name, | 228 name, |
229 scratch, | 229 scratch, |
(...skipping 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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_MIPS | 1507 #endif // V8_TARGET_ARCH_MIPS |
OLD | NEW |