In JDK-8133300 we decided on not caching ASTs resulting from the compilation pre-pass. The main reason for this is a surprising difficulty of making it play nicely with apply-to-call (a2c) specialization (a2c generates specialized function signatures for a normally varargs-only function, so the resulting AST is inherently specific to the type specialization arity and thus non-cacheable). However, this results in inability to cache pre-pass ASTs in general (except for split functions), while that might still be desirable to further eliminate processing time.
Caching pre-pass non-split ASTs is desirable; in order to implement it we need to:
- make sure ApplySpecialization is rewritten so that it marks all transformation-subjected functions as non-cacheable
- make sure Symbol.useCount is recomputed when the function is cached
- make sure any other possible discrepancies between eager and on-demand compilation are smoothed over.