JDK-8143304 : Random failures when script size exceeds token limits
  • Type: Bug
  • Component: core-libs
  • Sub-Component: jdk.nashorn
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2015-11-19
  • Updated: 2015-11-29
  • Resolved: 2015-11-20
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 9
9 b94Fixed
Related Reports
Relates :  
Description
There is a regression when running JDK-8029952 in JDK9. A TypeError is thrown during the on-demand parsing of the main script function. The reason is that the length of the script exceeds the 24 bits available in the function token. We currently encode tokens into a long where 8 bits are used for the token type, 24 bits for the token length, and the remaining 32 bits for the token position. 

The suggested fix is to use 28 bits for both token position and length, given that they can both get roughly the size of the source code. 2^28 (roughly 260 MB) should still be enough for code size.