JDK-8223527 : Clean up JVM implementation of hidden classes
  • Type: Bug
  • Component: hotspot
  • Sub-Component: runtime
  • Affected Version: repo-valhalla
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2019-05-07
  • Updated: 2019-09-26
  • Resolved: 2019-09-26
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.
Other
repo-valhallaFixed
Related Reports
Relates :  
Relates :  
Description
This issue tracks some implementation clean up issues for hidden classes in the nestmates branch.

1. rename "is_nonfindable" to "is_hidden"
2. the name of the hidden class is assigned by the VM (Klass::external_name)

    The name parameter in JVM_LookupDefineClass is simply a binary name that can be used by the VM as a prefix but not guaranteed to be unique.    The VM appends the name with "/" and unique id (address of the klass in the implementation) to follow the long-standing convention of Unsafe VM anonymous class.

The name of `this_class` in the CP entry should be re-examined if it should be set to a sentinel value or NULL. 

3. define struct ClassLoadInfo to wire all random bits in one place (something like bootstrapInfo.hpp) (see  JDK-8230816)

4. It may be useful to augment VM logging to show other properties when a hidden class is created (e.g. weak or nest host or etc) 
Comments
Changeset: 40df6530c76b Author: hseigel Date: 2019-09-26 17:32 +0000 URL: https://hg.openjdk.java.net/valhalla/valhalla/rev/40df6530c76b 8223527: Clean up JVM implementation of hidden classes Summary: Patch hidden class name in cp, ignore nestmate attributes for hidden classes, return name with '/' in external_name() Reviewed-by: dholmes, mchung ! src/hotspot/share/classfile/classFileParser.cpp ! src/hotspot/share/oops/instanceKlass.cpp ! src/hotspot/share/oops/instanceKlass.hpp ! src/hotspot/share/oops/klass.cpp + test/hotspot/jtreg/runtime/HiddenClasses/DefineHiddenClass.java + test/hotspot/jtreg/runtime/HiddenClasses/hidden/NameInString.java
26-09-2019

The above comments quoted from John will be handled as part of JDK-8230816.
16-09-2019