Closed Bug 939824 Opened 11 years ago Closed 11 years ago

Factor out the backtracking allocator's splitting logic

Categories

(Core :: JavaScript Engine: JIT, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla28

People

(Reporter: sunfish, Assigned: sunfish)

References

Details

(Whiteboard: [qa-])

Attachments

(3 files, 2 obsolete files)

Attached patch regalloc-refactor-splitat.patch (obsolete) — Splinter Review
The backtracking allocator has several different splitting methods: trySplitAcrossHotcode, trySplitAfterLastRegisterUse, and splitAcrossCalls, and there is a fair amount of code which is common between them which could be factored out. It would also help the development of new splitting heuristics to avoid needing to re-implement a lot of the mechanics.
Attached patch regalloc-splitat-nicely.patch (obsolete) — Splinter Review
This patch improves up the new splitAt routine to avoid splitting the LiveInterval at range boundaries. This is a minor optimization, at it reduces unnecessary spilling at range boundaries.
Attachment #8333892 - Attachment is obsolete: true
Attachment #8333893 - Attachment is obsolete: true
Comment on attachment 8333892 [details] [diff] [review] regalloc-refactor-splitat.patch This patch separates most of the mechanism from the policy of trySplitAcrossCalls.
Attachment #8333892 - Flags: review?(bhackett1024)
Attachment #8333892 - Flags: review?(bhackett1024)
Comment on attachment 8336050 [details] [diff] [review] regalloc-refactor-splitat.patch Oops, here is the updated version of the patch.
Attachment #8336050 - Flags: review?(bhackett1024)
Comment on attachment 8336051 [details] [diff] [review] regalloc-splitat-nicely.patch Previously, this code created new LiveIntervals at every Range boundary, which led to unnecessary spilling. This patch introduces new LiveIntervals only at the specified split points.
Attachment #8336051 - Flags: review?(bhackett1024)
This patch converts trySplitAcrossHotcode to use the new splitAt, which is a nice demonstration of its utility.
Attachment #8336083 - Flags: review?(bhackett1024)
Blocks: 941652
Comment on attachment 8336050 [details] [diff] [review] regalloc-refactor-splitat.patch Review of attachment 8336050 [details] [diff] [review]: ----------------------------------------------------------------- Thanks! ::: js/src/jit/BacktrackingAllocator.cpp @@ +1715,5 @@ > } > > +// Find the next split position after the current position. > +static size_t NextSplitPosition(size_t activeSplitPosition, > + const Vector<CodePosition, 4, SystemAllocPolicy> &splitPositions, This Vector<...> (and, generally, any Vector<...> that otherwise would have to be typed twice) should be a typedef.
Attachment #8336050 - Flags: review?(bhackett1024) → review+
Attachment #8336051 - Flags: review?(bhackett1024) → review+
Attachment #8336083 - Flags: review?(bhackett1024) → review+
(In reply to Brian Hackett (:bhackett) from comment #8) > Comment on attachment 8336050 [details] [diff] [review] > regalloc-refactor-splitat.patch > > Review of attachment 8336050 [details] [diff] [review]: > ----------------------------------------------------------------- > > Thanks! Thanks for the reviews! > ::: js/src/jit/BacktrackingAllocator.cpp > @@ +1715,5 @@ > > } > > > > +// Find the next split position after the current position. > > +static size_t NextSplitPosition(size_t activeSplitPosition, > > + const Vector<CodePosition, 4, SystemAllocPolicy> &splitPositions, > > This Vector<...> (and, generally, any Vector<...> that otherwise would have > to be typed twice) should be a typedef. Ok. Typedef added and code updated to use it. https://hg.mozilla.org/integration/mozilla-inbound/rev/f3333afffd24 https://hg.mozilla.org/integration/mozilla-inbound/rev/01333a597b9a https://hg.mozilla.org/integration/mozilla-inbound/rev/2dc657af3475
Whiteboard: [qa-]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: