Troubleshooting Nashorn “Method code too large!” exception

前端 未结 2 1635
一整个雨季
一整个雨季 2021-01-14 14:31

Running jjs or ScriptEngine#eval on my JavaScript (https://gist.github.com/also/005fd7c200b20f012e10) crashes with this exception and no more detai

相关标签:
2条回答
  • 2021-01-14 14:50

    Nashorn tries to split too large scripts/functions into smaller blocks to compile to bytecode to workaround the per method bytecode size limit imposed by JVM. The Nashorn splitter has improved in jdk 1.8.0 update 40 (being developed, not yet released - but early access available from https://jdk8.java.net/download.html. You may want to try that as well.

    0 讨论(0)
  • 2021-01-14 15:07

    The current JDK 8u40 is still throwing the bug. Ref the detailed note on:

    http://skrishnamachari.wordpress.com/2014/06/18/nashorn-bug/

    Also is there a possibility to access the latest Nashorn source to be able to quickly debug through. Atleast find a hack/ validate and have it stick for our use till some final patch is provided.

    0 讨论(0)
提交回复
热议问题