Closed Bug 678598 Opened 10 years ago Closed 10 years ago
Monkey: LICM unnecessarily inserts at the front of a vector
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)
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.
Status: ASSIGNED → RESOLVED
Closed: 10 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.