Open Bug 2004798 Opened 1 day ago Updated 1 day ago

Support CacheIR ops implemented via self-hosted code

Categories

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

enhancement

Tracking

()

People

(Reporter: iain, Unassigned)

References

(Blocks 3 open bugs)

Details

We have a number of language features, particularly involving the iterator protocol, that follow a similar pattern: the common case involves arrays and the fast path could be very efficient, but the slow path can be quite complicated. It would be nice if we could implement these features using ICs, but the slow path is too complicated, because it involves multiple steps that could each have side effects / fail / bail out. As a result, we usually desugar the iterator protocol into a large pile of bytecode, and then rely on inlining and scalar replacement to try to recover the ideal performance in the array case.

One option (more extensively explored in this doc) is to use self-hosted code to implement complex slow paths, and call into that self-hosted code from CacheIR. This would allow us to add iterator ops that generate efficient code in the array case, while still handling non-array cases correctly / ergonomically.

(Opening this bug because I was about to leave yet another link to that doc in bug 2004747.)

Blocks: 2004747
You need to log in before you can comment on or make changes to this bug.