Closed Bug 1922227 Opened 2 months ago Closed 2 months ago

Use a Vector instead of linked list + AvlTree for call positions

Categories

(Core :: JavaScript Engine: JIT, task, P1)

task

Tracking

()

RESOLVED FIXED
133 Branch
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:

  • CallRange is always a length-one range and we only look at its from position.
  • These call ranges are stored in both a linked list (callRangesList) and in an AvlTree.

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.

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.

Pushed by jdemooij@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3be712f2e110 Store call positions in a Vector instead of a linked list + AvlTree. r=jseward
Severity: -- → N/A
Priority: -- → P1
Status: ASSIGNED → RESOLVED
Closed: 2 months ago
Resolution: --- → FIXED
Target Milestone: --- → 133 Branch
Whiteboard: [sp3]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: