Tweak handling of removed entries in HashTable::lookup()

RESOLVED FIXED in Firefox 63

Status

()

enhancement
RESOLVED FIXED
Last year
Last year

People

(Reporter: njn, Assigned: njn)

Tracking

unspecified
mozilla63
Points:
---

Firefox Tracking Flags

(firefox63 fixed)

Details

Attachments

(2 attachments)

There are two improvements here.

- When we're just doing a lookup (i.e. aCollisionBit==0), we don't need to
  do any special handling of removed entries. (Inlining means that the removed
  entry code is entirely removed for lookups.)

- When we're doing an insertion (i.e. aCollisionBit==sCollisionBit), we now
  stop adding collision markings once we find a removed entry, because they're
  unnecessary after that point.

This change brings the code in alignment with PLDHashTable::SearchTable().
Comment on attachment 8996954 [details] [diff] [review]
Tweak handling of removed entries in HashTable::lookup()

Review of attachment 8996954 [details] [diff] [review]:
-----------------------------------------------------------------

Nice find!
Attachment #8996954 - Flags: review?(luke) → review+
Again inspired by PLDHashTable, this makes things a bit clearer than passing 0
or sCollisionBit.

It also guarantees more strongly that we'll end up with appropriately
specialized code for the Add vs. NonAdd cases. (That guarantee isn't currently
needed because the compiler inlines things sufficiently anyway, but it can't
hurt.)
Attachment #8997177 - Flags: review?(luke)
Comment on attachment 8997177 [details] [diff] [review]
Introduce HashTable::LookupReason

Review of attachment 8997177 [details] [diff] [review]:
-----------------------------------------------------------------

Yes, much clearer, thanks.
Attachment #8997177 - Flags: review?(luke) → review+
Pushed by nnethercote@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/d9baec9cf420
Tweak handling of removed entries in HashTable::lookup(). r=luke
https://hg.mozilla.org/integration/mozilla-inbound/rev/6c0410ddd1f6
Introduce HashTable::LookupReason. r=luke
https://hg.mozilla.org/mozilla-central/rev/d9baec9cf420
https://hg.mozilla.org/mozilla-central/rev/6c0410ddd1f6
Status: ASSIGNED → RESOLVED
Closed: Last year
Resolution: --- → FIXED
Target Milestone: --- → mozilla63
You need to log in before you can comment on or make changes to this bug.