Align hash fields in all atom subtypes
Categories
(Core :: JavaScript Engine, enhancement, P1)
Tracking
()
Tracking | Status | |
---|---|---|
firefox123 | --- | fixed |
People
(Reporter: sfink, Assigned: sfink)
References
(Blocks 1 open bug)
Details
(Whiteboard: [sp3])
Attachments
(6 files, 2 obsolete files)
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review | |
48 bytes,
text/x-phabricator-request
|
Details | Review |
From Doug & Iain, it looks like it would help some to align the hash_ member of JSAtom subclasses to avoid having to branch on the flags. That does mean shrinking fat inline atoms down from 40 -> 32 bytes on 64-bit, which would ordinarily mean losing 8 bytes of inline space (so 24->16 bytes). But the hash value is only 32 bits and it can be aligned at the end, so this only loses 4 bytes instead (24->20 max inline bytes on 64-bit). Not only that, but this makes thin and fat inline atoms be the same size, so we can merge them (or discard one, depending on how you want to think about it.)
This does add some complexity because now there are 3 inline string length limits (per CharT). This caused less trouble than I expected, because most callers already know whether they're dealing with strings or atoms.
Assignee | ||
Comment 1•1 year ago
|
||
Assignee | ||
Comment 2•1 year ago
|
||
Assignee | ||
Comment 3•1 year ago
|
||
Note that this is temporary, and will be removed later in this stack after there is only one type of inline atom.
Assignee | ||
Comment 4•1 year ago
|
||
Assignee | ||
Comment 5•1 year ago
|
||
Assignee | ||
Comment 6•1 year ago
|
||
Assignee | ||
Comment 7•1 year ago
|
||
Assignee | ||
Comment 8•1 year ago
|
||
Updated•1 year ago
|
Comment 9•1 year ago
|
||
This is great. Thanks for looking into this!
Updated•1 year ago
|
Updated•1 year ago
|
Assignee | ||
Comment 10•1 year ago
|
||
Status: it seems to fully work on 64-bit, so I started looking at 32-bit. Sadly, I don't think we can do the same thing on 32-bit. At best, we can gain back the 4 bytes from inline atoms, but we can't have a single offset for all hash values (and that means I need to bring back all the JIT code I deleted, and just make it 32 bit only.)
I do have an idea for speeding up the 32-bit hash load very slightly, but I'll try that out after settling the rest of this. It may require some reworking of flag bits, and I'm not 100% sure it'll work. I'll file the bug in case someone else wants to tell me why it's stupid: bug 1865900.
Updated•1 year ago
|
Updated•1 year ago
|
Updated•1 year ago
|
Comment 11•1 year ago
|
||
Comment 12•1 year ago
|
||
bugherder |
https://hg.mozilla.org/mozilla-central/rev/005d4a0ae4b4
https://hg.mozilla.org/mozilla-central/rev/15de8d55fe36
https://hg.mozilla.org/mozilla-central/rev/c61c8700f220
https://hg.mozilla.org/mozilla-central/rev/1144485344ae
https://hg.mozilla.org/mozilla-central/rev/912abfedeb09
https://hg.mozilla.org/mozilla-central/rev/0c74789d4118
Description
•