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

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

Issue 2147433002: [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: Improved stub cache tests and the fixes. 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/ppc/stub-cache-ppc.cc ('k') | src/ic/stub-cache.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/ic/s390/stub-cache-s390.cc
diff --git a/src/ic/s390/stub-cache-s390.cc b/src/ic/s390/stub-cache-s390.cc
index b132ba057165ccf6ad81752d46b3d0ed93e61dff..1e6af723866a1ee51d3cfc1ad631255bbe3889db 100644
--- a/src/ic/s390/stub-cache-s390.cc
+++ b/src/ic/s390/stub-cache-s390.cc
@@ -15,8 +15,7 @@ namespace internal {
#define __ ACCESS_MASM(masm)
static void ProbeTable(StubCache* stub_cache, MacroAssembler* masm,
- Code::Flags flags, StubCache::Table table,
- Register receiver, Register name,
+ StubCache::Table table, Register receiver, Register name,
// Number of the cache entry, not scaled.
Register offset, Register scratch, Register scratch2,
Register offset_scratch) {
@@ -70,7 +69,10 @@ static void ProbeTable(StubCache* stub_cache, MacroAssembler* masm,
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;
__ LoadlW(flags_reg, FieldMemOperand(code, Code::kFlagsOffset));
@@ -78,9 +80,8 @@ static void ProbeTable(StubCache* stub_cache, MacroAssembler* masm,
DCHECK(!r0.is(flags_reg));
__ AndP(flags_reg, flags_reg, Operand(~Code::kFlagsNotUsedInLookup));
__ CmpLogicalP(flags_reg, Operand(flags));
- __ bne(&miss, Label::kNear);
+ __ Check(eq, kUnexpectedValue);
-#ifdef DEBUG
if (FLAG_test_secondary_stub_cache && table == StubCache::kPrimary) {
__ b(&miss, Label::kNear);
} else if (FLAG_test_primary_stub_cache && table == StubCache::kSecondary) {
@@ -100,9 +101,6 @@ static void ProbeTable(StubCache* stub_cache, MacroAssembler* masm,
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_S390X
@@ -153,24 +151,23 @@ void StubCache::GenerateProbe(MacroAssembler* masm, Register receiver,
__ LoadlW(scratch, FieldMemOperand(name, Name::kHashFieldOffset));
__ LoadP(ip, FieldMemOperand(receiver, HeapObject::kMapOffset));
__ AddP(scratch, scratch, ip);
- __ XorP(scratch, scratch, Operand(flags));
// The mask omits the last two bits because they are not part of the hash.
__ AndP(scratch, scratch,
Operand((kPrimaryTableSize - 1) << kCacheIndexShift));
// Probe the primary table.
- ProbeTable(this, masm, flags, kPrimary, receiver, name, scratch, extra,
- extra2, extra3);
+ ProbeTable(this, masm, kPrimary, receiver, name, scratch, extra, extra2,
+ extra3);
// Primary miss: Compute hash for secondary probe.
__ SubP(scratch, scratch, name);
- __ AddP(scratch, scratch, Operand(flags));
+ __ AddP(scratch, scratch, Operand(kSecondaryMagic));
__ AndP(scratch, scratch,
Operand((kSecondaryTableSize - 1) << kCacheIndexShift));
// Probe the secondary table.
- ProbeTable(this, masm, flags, kSecondary, receiver, name, scratch, extra,
- extra2, extra3);
+ ProbeTable(this, masm, 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/ppc/stub-cache-ppc.cc ('k') | src/ic/stub-cache.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698