points by nightpool 6 months ago

    [Speculative optimizations] may not suffice in this case as future planned optimizations may wish to rely not only on immutability within the lifetime of the process, but also on the immutability of fields from one run of the application to the next.
Can someone elaborate a little more on what this means? I'm very surprised to hear that this was considered a blocker important enough to add all of this complicated machinery (and breaking several deserialization libraries...), when I've never even heard of such an optimization and can't imagine what sort of form it would take
pron 6 months ago

There's ongoing work, as part of Project Leyden, to cache certain computations -- either performed by the user code or the JVM -- from one run of the program to the next, including the caching of JIT-compiled machine code. The early parts of this work were discussed here: https://www.morling.dev/blog/jep-483-aot-class-loading-linki...

xxs 6 months ago

This is rather old[0] but still relevant.

Surprise #2! A popular open-source framework writes to final fields after object construction via generated bytecodes!... This optimization of the final field is *the* main optimization performed on final fields.

[0] https://web.archive.org/web/20121016082428/http://www.azulsy...

Misdicorl 6 months ago

I suppose serializing the JVM state itself to avoid the cold start problem might take advantage of this?

  • nightpool 6 months ago

    Why would that prevent the JVM from using the same speculative optimization JIT with deoptimization hooks approach?

    • Misdicorl 6 months ago

      It wouldn't, but it might preclude using (future) optimizations that forgo those de-optimization hooks?