Use a Vector instead of linked list + AvlTree for call positions
Categories
(Core :: JavaScript Engine: JIT, task, P1)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox133 | --- | fixed |
People
(Reporter: jandem, Assigned: jandem)
References
Details
(Whiteboard: [sp3])
Attachments
(1 file)
The register allocator is a bit wasteful with how it tracks the position of call instructions:
CallRangeis always a length-one range and we only look at itsfromposition.- These call ranges are stored in both a linked list (
callRangesList) and in anAvlTree.
It's simpler and more efficient to store the list of positions in a Vector and do a binary search on that. It's a little faster for some large Wasm modules but also uses less memory and should be more cache friendly.
| Assignee | ||
Comment 1•1 year ago
|
||
CallRange was always a length-1 range and in splitAcrossCalls we only looked at its
from position. This patch removes CallRange and only stores the from position.
Store this list of positions in a Vector instead of a linked list + AvlTree. Because
the Vector is sorted, we can do a binary search on it to find the first position within
a range.
LIR generation now tracks the number of call instructions so that the register allocator
can grow the Vector to the right size.
This speeds up Ion compilation of some large Wasm modules by 1-2%, but it's also simpler
and should use less memory.
Updated•1 year ago
|
Comment 3•1 year ago
|
||
| bugherder | ||
Updated•1 year ago
|
Updated•1 year ago
|
Description
•