JDK-8058100 : Reduce the RecompilableScriptFunctionData footprint
  • Type: Enhancement
  • Component: core-libs
  • Sub-Component: jdk.nashorn
  • Affected Version: 9
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: generic
  • CPU: generic
  • Submitted: 2014-09-10
  • Updated: 2015-06-04
  • Resolved: 2014-09-11
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
8u40Fixed 9 b31Fixed
Description
RecompilableScriptFunctionData instances have gotten pretty big. There are some opportunities for reducing their footprint:

- most functions have empty nestedFunctions. Canonicalizing them with Collections.emptyMap() would help.
- most functions have empty internalSymbols. Canonicalizing them with Collections.emptySet() would help.
- most functions (those that don't set any this.* properties) will have the same allocatorClassName (JO4, currently) and an empty allocatorMap. By extracting the tuple of (allocatorClassName, allocatorMap, allocator) into a separate small AllocatorStrategy class and keeping a canonical DEFAULT_STRATEGY instance around for representing allocator strategy for functions that don't initialize any this.* properties, we could eliminate 2 fields, and reduce the number of class names and empty property maps around.