All users were logged out of Bugzilla on October 13th, 2018

IonMonkey: LICM unnecessarily inserts at the front of a vector

RESOLVED FIXED

Status

()

RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: rpearl, Assigned: rpearl)

Tracking

(Blocks: 1 bug)

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

7 years ago
Created attachment 552744 [details] [diff] [review]
patch v0

in Loop::optimize(), instructions are inserted into the front of a vector. Inserting into the front of a vector causes all the other elements to be shifted forward. 

In Loop::hoistInstructions(), instructions are popped off the back of the vector, so the order is just a reverse iteration, except with unecessary book-keeping of the length, due to popping off the vector.

If we switch to inserting at the end of the vector, and just iterate through (now forwards to backwards, since we have switched the order of insertion) then there is less bookkeeping to do.

I'm filing this as a bug because I just want to be sure there are no assumptions that I'm missing.
Attachment #552744 - Flags: review?(ascheff)

Comment 1

7 years ago
This is fine. I had left this in with the thought that I would eventually remove the vector data structure and change it to a js::Deque (https://bugzilla.mozilla.org/show_bug.cgi?id=663281) This fix is ok, though.

Updated

7 years ago
Attachment #552744 - Flags: review?(ascheff) → review+
(Assignee)

Comment 2

7 years ago
http://hg.mozilla.org/projects/ionmonkey/rev/e8ce2d102fda
Status: ASSIGNED → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.