Closed
Bug 511040
Opened 16 years ago
Closed 16 years ago
NJ: flesh out the hashtable in nanojit/Containers.h a bit
Categories
(Core :: JavaScript Engine, defect)
Core
JavaScript Engine
Tracking
()
RESOLVED
FIXED
Tracking | Status | |
---|---|---|
status1.9.2 | --- | beta1-fixed |
People
(Reporter: graydon, Assigned: graydon)
References
Details
(Whiteboard: fixed-in-tracemonkey)
Attachments
(1 file)
6.21 KB,
patch
|
edwsmith
:
review+
|
Details | Diff | Splinter Review |
The nanojit allocator-based hashtable type has some implementation inefficiencies (it takes and returns by-value structures, where it could use const &), and limits itself to int32_t for no reason I can see, and also doesn't handle general key types.
The attached patch fixes these issues. The provided general-purpose hash is murmurhash 2, a relatively fast word-based one popular these days among the cool kids. It's done as a template parameter on the hashtable so we can use different ones too (I'm intending to use different ones for the JIT cache tables that are replacing Fragmento).
Attachment #394988 -
Flags: review?(edwsmith)
Comment 1•16 years ago
|
||
any profile data? in other cases we've specialized the hash function for one-word (pointer) values, and most if not all current uses of HashMap fit this pattern, using either NIns* or LIns* as keys. This is also why the current code used K directly instead of const K& for key values.
Assignee | ||
Comment 2•16 years ago
|
||
No profile data driving it, no. I'm just beginning to use it to store non-pointer key structures, figured I'd avoid calling all the copy constructors. I imagine it'll run *ok* either way, we're talking 3-5 word key structures, usually. I'd prefer to keep the signatures const & just to avoid thinking about key and value sizes, but can omit that if you feel strongly.
I'm happy to make a specialization of the hasher, at least, for word-sized keys.
Updated•16 years ago
|
Attachment #394988 -
Flags: review?(edwsmith) → review+
Comment 3•16 years ago
|
||
Comment on attachment 394988 [details] [diff] [review]
Brand new shiny bits
I dont feel strongly about const &, at least until we get some evidence of a problem, sounds fine
Assignee | ||
Comment 4•16 years ago
|
||
http://hg.mozilla.org/tracemonkey/rev/82528a81a981
(with partial specialization for pointer keys, restoring the old hash)
Whiteboard: fixed-in-tracemonkey
Comment 5•16 years ago
|
||
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Comment 6•16 years ago
|
||
status1.9.2:
--- → beta1-fixed
Assignee | ||
Updated•16 years ago
|
Flags: in-testsuite-
You need to log in
before you can comment on or make changes to this bug.
Description
•