Closed Bug 678602 Opened 13 years ago Closed 13 years ago

IonMonkey: Eliminate gross deallocation hack in linear scan register allocator

Categories

(Core :: JavaScript Engine, defect)

x86_64
Linux
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: adrake, Unassigned)

References

Details

Attachments

(1 file)

Attached patch Patch v0Splinter Review
This also eliminates bugs where we end up allocating registers to things that don't need them before things that do.
Attachment #552750 - Flags: review?(dvander)
Depends on: 677339
No longer depends on: 677339
Blocks: 670628
The fundamental problem we encounter is that after we split intervals for a while, we end up with a situation where we have ten intervals or so that all start at the same code position. As the work list is sorted by start position, these intervals can be processed in an arbitrary order. Say F=fixed register, R=any register, A=anything. Situations that can trigger issues include:

RRRRRRRRFF # All registers are taken before fixed intervals. This is what the
           # gross deallocation hack covers.

AAAAAAAARR # All registers are needlessly taken before things that must have
           # registers are processed.

One could imagine all sorts of exciting mixtures of these situations, but this priority inversion arises when an "anything" interval gets processed before an "any register" interval, or "any register" interval gets processed before a "fixed register" interval.

To solve this, we sort the interval list with a tiebreaker. F before R, R before A ensures that none of these inversions can happen. The setIntervalPriority function assigns a priority to every interval that ensures that this holds (0 corresponds to F, 1 to R, and 2 to A).

The rest of the patch is refactoring that I did to catch assertions that I tripped while testing this patch. I can try to extricate the priority stuff if you want.
Comment on attachment 552750 [details] [diff] [review]
Patch v0

Review of attachment 552750 [details] [diff] [review]:
-----------------------------------------------------------------

Thanks for the explanation!
Attachment #552750 - Flags: review?(dvander) → review+
http://hg.mozilla.org/projects/ionmonkey/rev/d6c0c813dd80
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.