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

consider implementing scalar replacement for iterators

RESOLVED FIXED

Status

()

P3
normal
RESOLVED FIXED
5 years ago
2 years ago

People

(Reporter: bkelly, Unassigned)

Tracking

({perf})

Trunk
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
Consider implementing scalar replacement in our JavaScript engine.  As discussed in bug 907077 it would be very useful in order to avoid object allocations on each iteration of the new es6 for-of loops.
Component: JavaScript Engine → JavaScript Engine: JIT
I am already working on this on my spare time as part of the rewrite of the Alias Analysis (Bug 897606) before implementing Escape Analysis (Bug 856533).

One of the problem of Scalar Replacement is that we need to add annotation into the resume points to recover the state of the iterator.  Recover instructions (Bug 878503) introduces a generic way to solve this problem for any MIR instructions which has an equivalent recover instructions.
Blocks: 856533
Depends on: 897606
Side note, we now have a form of scalar replacement in IonMonkey (see Bug 992845 and Bug 1040027).
Still, I do think that the current implementation of our scalar replacement need some improvement such as Bug 897606, on which I will work in the next few weeks.
Summary: consider implementing scalar replacement optimization → consider implementing scalar replacement for iterators
This issue got fixed with the landing of Scalar Replacement.  Still I will note that even if the next function can be inlined as well as the object returned by the next function, the iterator object is not inlined if we OSR in the loop, but it would be if we enter the loop frequently.
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Priority: -- → P3
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.