OrderedHashTable should have a hashShift field like HashTable

RESOLVED FIXED in mozilla17

Status

()

Core
JavaScript Engine
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: jorendorff, Assigned: jorendorff)

Tracking

Other Branch
mozilla17
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: [js:t])

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
The hashing scheme of js::HashTable uses the most significant bits of a prepared hash code to select a hash bucket.  js::OrderedHashTable uses the least significant bits, which is very bad.
Whiteboard: [js:t]
(Assignee)

Comment 1

5 years ago
Created attachment 645687 [details] [diff] [review]
v1
Assignee: general → jorendorff
Attachment #645687 - Flags: review?(luke)
(Assignee)

Comment 2

5 years ago
A quick note on this patch:
>-  if (hashTableMask > initialBuckets() && liveCount < dataLength * minDataFill()) {
>+  if (hashBuckets() > initialBuckets() && liveCount < dataLength * minDataFill()) {

This changes the behavior, because hashTableMask is the number of buckets minus one.

The old behavior was accidental--a bug, but harmless as long as initialBuckets() was more than 1.

Updated

5 years ago
Attachment #645687 - Flags: review?(luke) → review+
(Assignee)

Comment 3

5 years ago
https://hg.mozilla.org/integration/mozilla-inbound/rev/0610488a81c9

Comment 4

5 years ago
https://hg.mozilla.org/mozilla-central/rev/0610488a81c9
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla17
You need to log in before you can comment on or make changes to this bug.