| 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 f38a8dc4aebe36c24e6da2fe798ba81c935e6bb6..0656d0329272cb19f08a2a5ab9822002e8eb6c48 100644
|
| --- a/src/ic/mips/stub-cache-mips.cc
|
| +++ b/src/ic/mips/stub-cache-mips.cc
|
| @@ -15,7 +15,8 @@
|
| #define __ ACCESS_MASM(masm)
|
|
|
| static void ProbeTable(StubCache* stub_cache, MacroAssembler* masm,
|
| - StubCache::Table table, Register receiver, Register name,
|
| + Code::Flags flags, StubCache::Table table,
|
| + Register receiver, Register name,
|
| // Number of the cache entry, not scaled.
|
| Register offset, Register scratch, Register scratch2,
|
| Register offset_scratch) {
|
| @@ -60,16 +61,14 @@
|
| scratch2 = no_reg;
|
| __ lw(code, MemOperand(base_addr, value_off_addr - key_off_addr));
|
|
|
| -#ifdef DEBUG
|
| // Check that the flags match what we're looking for.
|
| - Code::Flags flags = Code::RemoveHolderFromFlags(
|
| - Code::ComputeHandlerFlags(stub_cache->ic_kind()));
|
| Register flags_reg = base_addr;
|
| base_addr = no_reg;
|
| __ lw(flags_reg, FieldMemOperand(code, Code::kFlagsOffset));
|
| __ And(flags_reg, flags_reg, Operand(~Code::kFlagsNotUsedInLookup));
|
| - __ Check(eq, kUnexpectedValue, flags_reg, Operand(flags));
|
| + __ Branch(&miss, ne, flags_reg, Operand(flags));
|
|
|
| +#ifdef DEBUG
|
| if (FLAG_test_secondary_stub_cache && table == StubCache::kPrimary) {
|
| __ jmp(&miss);
|
| } else if (FLAG_test_primary_stub_cache && table == StubCache::kSecondary) {
|
| @@ -88,6 +87,9 @@
|
| void StubCache::GenerateProbe(MacroAssembler* masm, Register receiver,
|
| Register name, Register scratch, Register extra,
|
| Register extra2, Register extra3) {
|
| + Code::Flags flags =
|
| + Code::RemoveHolderFromFlags(Code::ComputeHandlerFlags(ic_kind_));
|
| +
|
| Label miss;
|
|
|
| // Make sure that code is valid. The multiplying code relies on the
|
| @@ -136,21 +138,23 @@
|
| // 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));
|
|
|
| // Probe the primary table.
|
| - ProbeTable(this, masm, kPrimary, receiver, name, scratch, extra, extra2,
|
| - extra3);
|
| + 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));
|
|
|
| // Probe the secondary table.
|
| - ProbeTable(this, masm, kSecondary, receiver, name, scratch, extra, extra2,
|
| - extra3);
|
| + ProbeTable(this, masm, flags, kSecondary, receiver, name, scratch, extra,
|
| + extra2, extra3);
|
|
|
| // Cache miss: Fall-through and let caller handle the miss by
|
| // entering the runtime system.
|
|
|