JDK-8078612 : Persistent code cache should support more configurations
  • Type: Bug
  • Component: core-libs
  • Sub-Component: jdk.nashorn
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2015-04-24
  • Updated: 2015-09-29
  • Resolved: 2015-05-05
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 8 JDK 9
8u60Fixed 9 b64Fixed
Description
Currently, the --persistent-code-cache option does not store outer script wrappers when optimistic types are enabled. Although this is a very thin wrapper class, not storing it will cause some parsing and code generation to take place, which shouldn't be necessary. 

The only time we should not store the outer script is if optimistic types are enabled but lazy compilation is not, because in this case the outer script would likely contain lots of wrong assumptions that would do harm for later runs when optimistic types are used with lazy compilation (as it should be). 

However, for non-optimistic types, lazy and non-lazy compilastion can be mixed in the code cache. In fact, a non-lazy compilation will probably be more efficient because it reads the whole script in one step.