JDK-8021350 : Share script classes between threads/globals within context
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: jdk.nashorn
  • Affected Version: 9
  • Priority: P2
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2013-07-25
  • Updated: 2015-02-06
  • Resolved: 2014-03-12
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.
8u20Fixed 9 b06Fixed
Related Reports
Duplicate :  
Relates :  
Relates :  
Relates :  
Currently the cache for compiled script classes is per global, i.e. other threads/globals will have to recompile the script. I think this is because of PropertyMaps in the static constants array of script classes used to have a reference to the prototype object. This isn't the case anymore, but there may still be problems with sharing maps unless they are duplicated for each global. 

We should find out and share the class cache among globals if possible.