Commit 0145ba86 authored by bjaideep's avatar bjaideep Committed by Commit bot

PPC: [ic] [stubs] Don't use Code::flags in megamorphic stub cache hash computations.

Port 8aeb7439

     Fix for ppc file, using macro functions to xor and add to
     handle the case when kPrimaryMagic/kSecondaryMagic is > 16bits.

R=ishell@chromium.org, joransiu@ca.ibm.com, jyan@ca.ibm.com, michael_dawson@ca.ibm.com, mbrandy@us.ibm.com

BUG=
LOG=N

Review-Url: https://codereview.chromium.org/2169183002
Cr-Commit-Position: refs/heads/master@{#37960}
parent 3cfd80d6
...@@ -142,7 +142,7 @@ void StubCache::GenerateProbe(MacroAssembler* masm, Register receiver, ...@@ -142,7 +142,7 @@ void StubCache::GenerateProbe(MacroAssembler* masm, Register receiver,
__ lwz(scratch, FieldMemOperand(name, Name::kHashFieldOffset)); __ lwz(scratch, FieldMemOperand(name, Name::kHashFieldOffset));
__ LoadP(ip, FieldMemOperand(receiver, HeapObject::kMapOffset)); __ LoadP(ip, FieldMemOperand(receiver, HeapObject::kMapOffset));
__ add(scratch, scratch, ip); __ add(scratch, scratch, ip);
__ xori(scratch, scratch, Operand(kPrimaryMagic)); __ Xor(scratch, scratch, Operand(kPrimaryMagic));
// The mask omits the last two bits because they are not part of the hash. // The mask omits the last two bits because they are not part of the hash.
__ andi(scratch, scratch, __ andi(scratch, scratch,
Operand((kPrimaryTableSize - 1) << kCacheIndexShift)); Operand((kPrimaryTableSize - 1) << kCacheIndexShift));
...@@ -153,7 +153,7 @@ void StubCache::GenerateProbe(MacroAssembler* masm, Register receiver, ...@@ -153,7 +153,7 @@ void StubCache::GenerateProbe(MacroAssembler* masm, Register receiver,
// Primary miss: Compute hash for secondary probe. // Primary miss: Compute hash for secondary probe.
__ sub(scratch, scratch, name); __ sub(scratch, scratch, name);
__ addi(scratch, scratch, Operand(kSecondaryMagic)); __ Add(scratch, scratch, kSecondaryMagic, r0);
__ andi(scratch, scratch, __ andi(scratch, scratch,
Operand((kSecondaryTableSize - 1) << kCacheIndexShift)); Operand((kSecondaryTableSize - 1) << kCacheIndexShift));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment