Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8223451

Make optimistic types disabled by default

    XMLWordPrintable

Details

    • Task
    • Resolution: Fixed
    • P4
    • 14
    • 13
    • core-libs
    • None
    • b06
    • generic
    • generic

    Description

      Optimistic types in Nashorn were enabled by default in JDK 9 by JDK-8060015 (technically a "backport" of JDK-8059811 which disabled it by default in JDK 8).

      Since then, user feedback and bug reports have shown that most common use of Nashorn seems to be running scripts that belong to the Node ecosystem and are part of the web developer toolchain. These scripts are often very large and complex, and usually run for a short time (script is executed once to perform some sort of conversion/compilation).

      Optimistic types are very detrimental in this kind of scenario, because Nashorn spends a lot of time optimizing and recompiling code that is only run once.

      Moreover, optimistic types are very complex and are the part of Nashorn that has received the least hardening/bug fixing. JDK-8222205 is just one example where a bug is caused by optimistic types and can be worked around by disabling the feature.

      On the basis of these facts, we should consider turning the default for optimistic types off in JDK 13 for the remaining lifespan of Nashorn. To summarize, the benefits would be:

        - Quicker execution of run-once scripts
        - Significant avoidance of bugs in script recompilation
        - Minimal risk of adding bugs that only manifest in non-optimistic mode

      Attachments

        Issue Links

          Activity

            People

              hannesw Hannes Wallnoefer
              hannesw Hannes Wallnoefer
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: