Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1953)

Unified Diff: src/ic/ppc/stub-cache-ppc.cc

Issue 2147213004: Revert of [ic] [stubs] Don't use Code::flags in megamorphic stub cache hash computations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@split-stub-cache
Patch Set: Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/ic/mips64/stub-cache-mips64.cc ('k') | src/ic/s390/stub-cache-s390.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/ppc/stub-cache-ppc.cc
diff --git a/src/ic/ppc/stub-cache-ppc.cc b/src/ic/ppc/stub-cache-ppc.cc
index 1cfc29fef8dc4059a3f07ed13da09491f3987992..1fff0a2fa89574755c743c490b26aecd48016247 100644
--- a/src/ic/ppc/stub-cache-ppc.cc
+++ b/src/ic/ppc/stub-cache-ppc.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) {
@@ -71,10 +72,7 @@
scratch2 = no_reg;
__ LoadP(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;
__ lwz(flags_reg, FieldMemOperand(code, Code::kFlagsOffset));
@@ -84,8 +82,9 @@
__ andc(flags_reg, flags_reg, r0);
__ mov(r0, Operand(flags));
__ cmpl(flags_reg, r0);
- __ Check(eq, kUnexpectedValue);
+ __ bne(&miss);
+#ifdef DEBUG
if (FLAG_test_secondary_stub_cache && table == StubCache::kPrimary) {
__ b(&miss);
} else if (FLAG_test_primary_stub_cache && table == StubCache::kSecondary) {
@@ -105,6 +104,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;
#if V8_TARGET_ARCH_PPC64
@@ -155,22 +157,24 @@
__ lwz(scratch, FieldMemOperand(name, Name::kHashFieldOffset));
__ LoadP(ip, FieldMemOperand(receiver, HeapObject::kMapOffset));
__ add(scratch, scratch, ip);
+ __ xori(scratch, scratch, Operand(flags));
// The mask omits the last two bits because they are not part of the hash.
__ andi(scratch, scratch,
Operand((kPrimaryTableSize - 1) << kCacheIndexShift));
// 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.
__ sub(scratch, scratch, name);
+ __ addi(scratch, scratch, Operand(flags));
__ andi(scratch, scratch,
Operand((kSecondaryTableSize - 1) << kCacheIndexShift));
// 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.
« no previous file with comments | « src/ic/mips64/stub-cache-mips64.cc ('k') | src/ic/s390/stub-cache-s390.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698