Open Bug 1846051 Opened 1 year ago Updated 1 year ago

Array destructuring is slow

Categories

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

enhancement

Tracking

()

People

(Reporter: dthayer, Assigned: dthayer)

References

(Blocks 2 open bugs)

Details

(Whiteboard: [sp3])

Attachments

(1 file)

Array destructuring currently follows the iterator protocol, which is unnecessarily slow. We should add a fast path in bytecode as a first step.

This is I think the simplest possible approach. This patch basically just
mirrors the OptimizeSpreadCall optimization, but for array destructuring.
We did add one constraint which has effects outside of this, which is that
the array iterator prototype can't have a return method defined. I think in
practice only very weird code should have this set, but we can be more
targeted if this is a real issue.

Severity: -- → N/A
Priority: -- → P1
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: