Beginning on October 25th, 2016, Persona will no longer be an option for authentication on BMO. For more details see Persona Deprecated.
Last Comment Bug 775896 - OrderedHashTable should have a hashShift field like HashTable
: OrderedHashTable should have a hashShift field like HashTable
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Other Branch
: All All
: -- normal (vote)
: mozilla17
Assigned To: Jason Orendorff [:jorendorff]
: general
: Jason Orendorff [:jorendorff]
Depends on: 743107
  Show dependency treegraph
Reported: 2012-07-20 03:33 PDT by Jason Orendorff [:jorendorff]
Modified: 2012-07-26 05:10 PDT (History)
1 user (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

v1 (12.41 KB, patch)
2012-07-25 03:03 PDT, Jason Orendorff [:jorendorff]
luke: review+
Details | Diff | Splinter Review

Description Jason Orendorff [:jorendorff] 2012-07-20 03:33:07 PDT
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.
Comment 1 Jason Orendorff [:jorendorff] 2012-07-25 03:03:59 PDT
Created attachment 645687 [details] [diff] [review]
Comment 2 Jason Orendorff [:jorendorff] 2012-07-25 04:39:21 PDT
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.
Comment 3 Jason Orendorff [:jorendorff] 2012-07-25 11:41:21 PDT
Comment 4 Ed Morley [:emorley] 2012-07-26 05:10:32 PDT

Note You need to log in before you can comment on or make changes to this bug.