Chromium Code Reviews| Index: src/ic/mips/stub-cache-mips.cc |
| diff --git a/src/ic/mips/stub-cache-mips.cc b/src/ic/mips/stub-cache-mips.cc |
| index e4dbcc6cd4d3500e0c2107b081f726c7dae38568..5433d0d8530fed31cb41577e492730c2d9f0c726 100644 |
| --- a/src/ic/mips/stub-cache-mips.cc |
| +++ b/src/ic/mips/stub-cache-mips.cc |
| @@ -45,7 +45,7 @@ static void ProbeTable(StubCache* stub_cache, MacroAssembler* masm, |
| // Calculate the base address of the entry. |
| __ li(base_addr, Operand(key_offset)); |
| - __ Lsa(base_addr, base_addr, offset_scratch, kPointerSizeLog2); |
| + __ Addu(base_addr, base_addr, offset_scratch); |
| // Check that the key in the entry matches the name. |
| __ lw(at, MemOperand(base_addr, 0)); |
| @@ -134,23 +134,21 @@ void StubCache::GenerateProbe(MacroAssembler* masm, Register receiver, |
| __ lw(scratch, FieldMemOperand(name, Name::kHashFieldOffset)); |
| __ lw(at, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
| __ Addu(scratch, scratch, at); |
| - uint32_t mask = kPrimaryTableSize - 1; |
| - // We shift out the last two bits because they are not part of the hash and |
| - // they are always 01 for maps. |
| - __ srl(scratch, scratch, kCacheIndexShift); |
| - __ Xor(scratch, scratch, Operand((flags >> kCacheIndexShift) & mask)); |
| - __ And(scratch, scratch, Operand(mask)); |
| + __ Xor(scratch, scratch, Operand(flags)); |
| + __ li(at, Operand(kPrimaryTableSize - 1)); |
| + __ sll(at, at, kCacheIndexShift); |
|
Jakob Kummerow
2016/07/20 12:09:45
Why not fold this into the instruction above?
__
Igor Sheludko
2016/07/20 13:40:26
Done.
|
| + __ And(scratch, scratch, at); |
| // Probe the primary table. |
| ProbeTable(this, masm, flags, kPrimary, receiver, name, scratch, extra, |
| extra2, extra3); |
| // Primary miss: Compute hash for secondary probe. |
| - __ srl(at, name, kCacheIndexShift); |
| - __ Subu(scratch, scratch, at); |
| - uint32_t mask2 = kSecondaryTableSize - 1; |
| - __ Addu(scratch, scratch, Operand((flags >> kCacheIndexShift) & mask2)); |
| - __ And(scratch, scratch, Operand(mask2)); |
| + __ Subu(scratch, scratch, name); |
| + __ Addu(scratch, scratch, Operand(flags)); |
| + __ li(at, Operand(kSecondaryTableSize - 1)); |
| + __ sll(at, at, kCacheIndexShift); |
| + __ And(scratch, scratch, at); |
| // Probe the secondary table. |
| ProbeTable(this, masm, flags, kSecondary, receiver, name, scratch, extra, |