Closed Bug 675129 Opened 13 years ago Closed 13 years ago

IonMonkey: Fix inefficient interval splitting in linear scan allocator

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: adrake, Unassigned)

References

Details

Attachments

(1 file)

Attached patch Patch v0Splinter Review
LiveInterval::splitAfter is inefficient due to iterated removal from the front of the vector. This patch reverses the order of iteration so all removal can be done at once from the end of the vector.
Attachment #549294 - Flags: review?(sstangl)
Comment on attachment 549294 [details] [diff] [review]
Patch v0

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

::: js/src/ion/LinearScan.cpp
@@ +185,5 @@
> +    after->ranges_.replaceRawBuffer(buffer, bufferLength);
> +
> +    // Move intervals back as required
> +    for (Range *i = &after->ranges_.back(); i >= after->ranges_.begin(); i--) {
> +        if (pos <= i->to) {

Clearer as below, and eliminates a level of indentation:
if (pos > i->to)
    continue;
Attachment #549294 - Flags: review?(sstangl) → review+
http://hg.mozilla.org/projects/ionmonkey/rev/3ed32da379a8
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.