Closed
Bug 1500926
Opened 6 years ago
Closed 6 years ago
Use a static perfect hash for WebIDLGlobalNameHash
Categories
(Core :: DOM: Bindings (WebIDL), enhancement)
Core
DOM: Bindings (WebIDL)
Tracking
()
RESOLVED
FIXED
mozilla65
Tracking | Status | |
---|---|---|
firefox65 | --- | fixed |
People
(Reporter: nika, Assigned: nika)
References
Details
Attachments
(3 files)
Currently we build an in-memory hash table containing this information, while we can instead use perfecthash.py to generate a static data structure.
My initial patches do not separate the table information requiring relocation data from those which do not, but that was done for simplicity of implementation. It may not be worthwhile to perform that refactoring, due to the relatively small size of the table (~800 entries).
Assignee | ||
Comment 1•6 years ago
|
||
This strategy allows us to dodge dynamic allocations in WebIDLGlobalNameHash.
This removes the Init() and Shutdown() methods, as well as Register. The
RegisterBindings.cpp file now only contains static data and one method
declaration for the WebIDLGlobalNameHash class.
This should also be faster by making the hashtable lookup infallible.
Depends on D9405
Assignee | ||
Comment 2•6 years ago
|
||
When running tests, we can build a WebIDL environment with no interfaces
exposed on the primary global. Unfortunately, due to the perfecthash.py logic
not handling empty tables, this causes an assertion to be raised.
We can work around this by generating some dummy code for that situation, as we
will never try to build it.
Depends on D9406
Assignee | ||
Comment 3•6 years ago
|
||
Depends on D9407
Pushed by nika@thelayzells.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/80b71708f7ca
Part 1: Use a statically generated perfect hash in WebIDLGlobalNameHash, r=bzbarsky
https://hg.mozilla.org/integration/mozilla-inbound/rev/3d9631fca868
Part 2: Support a test-only edgecase in Codegen.py, r=bzbarsky
https://hg.mozilla.org/integration/mozilla-inbound/rev/8b0b407e053f
Part 3: Remove unused WebIDL Codegen items, r=bzbarsky
Comment 5•6 years ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/80b71708f7ca
https://hg.mozilla.org/mozilla-central/rev/3d9631fca868
https://hg.mozilla.org/mozilla-central/rev/8b0b407e053f
Status: NEW → RESOLVED
Closed: 6 years ago
status-firefox65:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
You need to log in
before you can comment on or make changes to this bug.
Description
•