Closed Bug 1483871 Opened 7 years ago Closed 11 months ago

Consider adding an optimized JIT entry for Function.prototype.call/apply

Categories

(Core :: JavaScript Engine, enhancement, P3)

enhancement

Tracking

()

RESOLVED WONTFIX

People

(Reporter: jandem, Unassigned)

References

(Blocks 1 open bug)

Details

A bit like bug 1483869: I think we could add an "optimized JIT entry" (a feature added for Wasm natives) to the fun_call/fun_apply JSNatives. This JIT entry point would just be a trampoline where we call the target function if it's scripted, or call into C++ if it's not. Once we have that, we can remove the Baseline ICs for call/apply and the similar Ion call optimizations.
Priority: -- → P3
If we go this route can we please wrap the pointers in a new data structure and make this a little more explicit? There is already enough hidden complexity with these "optimized JIT entries" having surprising coupling to the GC relocation mechanism.
Severity: normal → S3

Iain... I feel like we have something like this these days via CacheIR. Close as WORKSFORME?

Flags: needinfo?(iireland)

I think this bug was opened before we had CacheIR-based call ICs in baseline.

We have a variety of different kinds of support in CacheIR now. Notably, using specialized CacheIR, we can inline through fun_call and some versions of fun_apply. The trampoline wouldn't help with that. We also have some support for fun_call in the Ion CallGeneric trampoline.

In general, I don't think generating an IC that calls a trampoline that calls the target function is an improvement over generating a fun_call/fun_apply-specific IC that calls the target function directly.

It seems unlikely that changes in this direction would make things faster. They might simplify things slightly, but our existing complexity seems reasonably self-contained. I think we can close this.

Status: NEW → RESOLVED
Closed: 11 months ago
Flags: needinfo?(iireland)
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.