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

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

Issue 2161153002: [ic] Fix megamorphic stub cache probing on some platforms. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
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
Index: src/ic/arm64/stub-cache-arm64.cc
diff --git a/src/ic/arm64/stub-cache-arm64.cc b/src/ic/arm64/stub-cache-arm64.cc
index bd219b0e33851d8735e69df1c77256ab99a49f1c..ba9df0453e4132fc8c17102759f07ee9710b6a00 100644
--- a/src/ic/arm64/stub-cache-arm64.cc
+++ b/src/ic/arm64/stub-cache-arm64.cc
@@ -48,7 +48,9 @@ static void ProbeTable(StubCache* stub_cache, MacroAssembler* masm,
// Calculate the base address of the entry.
__ Mov(scratch, key_offset);
Jakob Kummerow 2016/07/20 12:09:45 Why is this instruction even needed? Wouldn't it s
Igor Sheludko 2016/07/20 13:40:26 Unfortunately we don't have such an instruction on
Jakob Kummerow 2016/07/20 13:50:01 Argh, my mistake. Somehow I thought |key_offset| w
- __ Add(scratch, scratch, Operand(scratch3, LSL, kPointerSizeLog2));
+ __ Add(
+ scratch, scratch,
+ Operand(scratch3, LSL, kPointerSizeLog2 - StubCache::kCacheIndexShift));
// Check that the key in the entry matches the name.
__ Ldr(scratch2, MemOperand(scratch));
@@ -128,22 +130,22 @@ void StubCache::GenerateProbe(MacroAssembler* masm, Register receiver,
__ JumpIfSmi(receiver, &miss);
// Compute the hash for primary table.
- __ Ldr(scratch, FieldMemOperand(name, Name::kHashFieldOffset));
+ __ Ldr(scratch.W(), FieldMemOperand(name, Name::kHashFieldOffset));
__ Ldr(extra, FieldMemOperand(receiver, HeapObject::kMapOffset));
__ Add(scratch, scratch, extra);
__ Eor(scratch, scratch, flags);
- // We shift out the last two bits because they are not part of the hash.
- __ Ubfx(scratch, scratch, kCacheIndexShift,
- CountTrailingZeros(kPrimaryTableSize, 64));
+ __ Mov(extra, Operand(kPrimaryTableSize - 1));
+ __ And(scratch, scratch, Operand(extra, LSL, kCacheIndexShift));
Jakob Kummerow 2016/07/20 12:09:45 IIUC, "And(scratch, scratch, Operand((kPrimaryTabl
Igor Sheludko 2016/07/20 13:40:26 Indeed. Done here and everywhere.
// Probe the primary table.
ProbeTable(this, masm, flags, kPrimary, receiver, name, scratch, extra,
extra2, extra3);
// Primary miss: Compute hash for secondary table.
- __ Sub(scratch, scratch, Operand(name, LSR, kCacheIndexShift));
- __ Add(scratch, scratch, flags >> kCacheIndexShift);
- __ And(scratch, scratch, kSecondaryTableSize - 1);
+ __ Sub(scratch, scratch, Operand(name));
+ __ Add(scratch, scratch, Operand(flags));
+ __ Mov(extra, Operand(kSecondaryTableSize - 1));
+ __ And(scratch, scratch, Operand(extra, LSL, kCacheIndexShift));
// Probe the secondary table.
ProbeTable(this, masm, flags, kSecondary, receiver, name, scratch, extra,

Powered by Google App Engine
This is Rietveld 408576698