Open Bug 1342068 Opened 9 years ago Updated 2 years ago

Make it easier to optimize functions whose return value isn't used

Categories

(Core :: JavaScript Engine: JIT, defect, P3)

defect

Tracking

()

Tracking Status
firefox54 --- affected

People

(Reporter: till, Unassigned)

References

Details

Some functions that return values are frequently called for their side effects, with the return value getting ignored. A prominent example of this is Array.prototype.splice. We do optimize that in ion, using quite a bit of boilerplate. It'd be very nice to be able to do this for more functions, such as Promise.prototype.then and Promise.prototype.catch, without requiring the duplication of all that boilerplate.
Blocks: 1342070
Wondering about this a little bit more. I think we might be able to add some optimization pass that checks if a MCall has no uses and replaces the called native function with a similar (same signature) function that doesn't return a value (or undefined/magic placeholder). Instead of adding a new MIR-node. (Note that the MIR-node might be more optimized, since it also specializes the input values.) @jandem: right?
Flags: needinfo?(jdemooij)
Priority: -- → P2
arai is fixing this in bug 1344477 by adding a separate bytecode op. I agree an Ion optimization pass could probably also work.
Depends on: 1344477
Flags: needinfo?(jdemooij)
Moving to p3 because no activity for at least 1 year(s). See https://github.com/mozilla/bug-handling/blob/master/policy/triage-bugzilla.md#how-do-you-triage for more information
Priority: P2 → P3
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.