Closed Bug 1820763 Opened 1 year ago Closed 1 year ago

Optimize Function.prototype.bind more

Categories

(Core :: JavaScript Engine: JIT, task, P1)

task

Tracking

()

RESOLVED FIXED
112 Branch
Tracking Status
firefox112 --- fixed

People

(Reporter: jandem, Assigned: jandem)

References

(Blocks 1 open bug)

Details

(Whiteboard: [sp3])

Attachments

(2 files)

React-TodoMVC allocates so many bound functions that it's worth adding a more specialized IC stub that lets us create a bound function without calling into C++. This improves React-TodoMVC by 3-4%.

This frees up the name NewBoundFunction for the next patch.

This specializes bind more for the target object. This way we can do everything
in JIT code without having to call into C++.

We initialize the name/length/flags slots of the template object and then at
runtime we only have to copy the template object and store the target and bound
this/arguments, after guarding the target's name/length properties are what we expect.

This improves Speedometer's React-TodoMVC by at least 3-4% because it creates many
bound functions (the target is also a bound function in this case).

Depends on D171866

Whiteboard: [sp3]
Severity: -- → N/A
Priority: -- → P1
Pushed by jdemooij@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/cfd54c278717
part 1 - Rename NewBoundFunction MIR/LIR instruction to BindFunction. r=iain
https://hg.mozilla.org/integration/autoland/rev/5f892b0237f0
part 2 - Optimize Function.prototype.bind more in JIT code. r=iain
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 112 Branch
Blocks: 1355096
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: