RFR: 8338939: Simplify processing of hidden class names

Markus Grönlund mgronlun at openjdk.org
Sun Aug 25 18:34:29 UTC 2024


Greetings,

The name symbol for hidden (anonymous) classes has evolved. Initially, it consisted of only a base class name, e.g., "java/lang/invoke/LambdaForm$BMH", so JFR had to introduce a scheme for disambiguating one anonymous class from another.

The scheme (which still exists in JFR) appends the Java class mirror's hashcode to the base class name, e.g., "java/lang/invoke/LambdaForm$BMH/22626602".

With [JDK-8238358](https://bugs.openjdk.org/browse/JDK-8238358), the disambiguation of hidden class names is now intrinsic to the processing by the ClassFileParser. This is done by appending the InstanceKlass address to the base class name, e.g., "java/lang/invoke/LambdaForm$BMH+0x000000001d190000".

An argument can be made that JFR specialization for hidden (anonymous) classes may no longer be necessary. Indeed, the result now involves a "double" disambiguation: e.g., "java/lang/invoke/LambdaForm$BMH+0x000000001d190000/231202600".

It is now possible to simplify the handling of hidden (anonymous) class names, which avoids using the Java mirror oop. We might want to keep the "/" construct as that might be an implicit invariant on users' expectations (quickly done by replacing "+" with "/").

Testing: jdk_jfr

Thanks
Markus

-------------

Commit messages:
 - external_name
 - 8338939

Changes: https://git.openjdk.org/jdk/pull/20708/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=20708&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8338939
  Stats: 58 lines in 2 files changed: 2 ins; 17 del; 39 mod
  Patch: https://git.openjdk.org/jdk/pull/20708.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/20708/head:pull/20708

PR: https://git.openjdk.org/jdk/pull/20708


More information about the hotspot-jfr-dev mailing list