Closed Bug 1885368 Opened 2 years ago Closed 7 months ago

Collect whole module information before compiling code with Ion

Categories

(Core :: JavaScript: WebAssembly, task, P3)

task

Tracking

()

RESOLVED WONTFIX

People

(Reporter: rhunt, Unassigned)

References

Details

We should add the generic ability to collect information from the 'whole module' of functions before we compile code in Ion. Right now, our Ion compiler is limited to only know about the ModuleEnvironment and it's own function's bytecode, but not any info from the definitions of other functions.

Some examples of this that would be useful:

  1. Does a function perform a tail call - can be used to have a better ABI
  2. What is the size of the function - used as an inlining hueristic

This is because we may be compiling in 'streaming mode' with baseline disabled, or may be compiling without streaming but have determined the module is small enough that we can just compile straight away with Ion. So we can't guarantee that we've seen the other definitions of functions before we start compiling one function with Ion.

I think we can workaround this limitation with two tweaks:

  1. Continue to support compiling Ion without 'whole module information', by falling back to conservative assumptions
  2. Performing a quick validation pass over the whole module before compiling with Ion when we're not streaming to collect this information
See Also: → 1849759

With lazy tiering we now can do this. Closing this in favor of the other bug which could actually use this information.

Status: NEW → RESOLVED
Closed: 7 months ago
Resolution: --- → WONTFIX
You need to log in before you can comment on or make changes to this bug.