Index: src/ic/mips64/stub-cache-mips64.cc |
diff --git a/src/ic/mips64/stub-cache-mips64.cc b/src/ic/mips64/stub-cache-mips64.cc |
index b4333916465be8b8082fb7a715699a8c7d39aa92..148851e95bdb2d195be9003bd918743c4789cd0f 100644 |
--- a/src/ic/mips64/stub-cache-mips64.cc |
+++ b/src/ic/mips64/stub-cache-mips64.cc |
@@ -45,7 +45,8 @@ static void ProbeTable(StubCache* stub_cache, MacroAssembler* masm, |
// Calculate the base address of the entry. |
__ li(base_addr, Operand(key_offset)); |
- __ Dlsa(base_addr, base_addr, offset_scratch, kPointerSizeLog2); |
+ __ Dlsa(base_addr, base_addr, offset_scratch, |
+ kPointerSizeLog2 - StubCache::kCacheIndexShift); |
// Check that the key in the entry matches the name. |
__ ld(at, MemOperand(base_addr, 0)); |
@@ -134,26 +135,24 @@ void StubCache::GenerateProbe(MacroAssembler* masm, Register receiver, |
__ JumpIfSmi(receiver, &miss); |
// Get the map of the receiver and compute the hash. |
- __ ld(scratch, FieldMemOperand(name, Name::kHashFieldOffset)); |
+ __ lwu(scratch, FieldMemOperand(name, Name::kHashFieldOffset)); |
__ ld(at, FieldMemOperand(receiver, HeapObject::kMapOffset)); |
- __ Daddu(scratch, scratch, at); |
- uint64_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. |
- __ dsrl(scratch, scratch, kCacheIndexShift); |
- __ Xor(scratch, scratch, Operand((flags >> kCacheIndexShift) & mask)); |
- __ And(scratch, scratch, Operand(mask)); |
+ __ Addu(scratch, scratch, at); |
+ __ Xor(scratch, scratch, Operand(flags)); |
+ __ li(at, Operand(kPrimaryTableSize - 1)); |
+ __ sll(at, at, kCacheIndexShift); |
Jakob Kummerow
2016/07/20 12:09:45
Same comment as for mips32 here.
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. |
- __ dsrl(at, name, kCacheIndexShift); |
- __ Dsubu(scratch, scratch, at); |
- uint64_t mask2 = kSecondaryTableSize - 1; |
- __ Daddu(scratch, scratch, Operand((flags >> kCacheIndexShift) & mask2)); |
- __ And(scratch, scratch, Operand(mask2)); |
+ __ Subu(scratch, scratch, name); |
+ __ Addu(scratch, scratch, 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, |