RFR: 8266642: improve ResolvedMethodTable hash function [v2]
Denghui Dong
ddong at openjdk.java.net
Tue May 11 03:12:55 UTC 2021
On Tue, 11 May 2021 02:35:13 GMT, Denghui Dong <ddong at openjdk.org> wrote:
>> But as you note, the name mangling for hidden classes would mean that the names are not actually the same. And I don't see how this introduces a different classloader-data. ??
>
> Unsafe.getUnsafe().defineAnonymousClass will create an unsafe anonymous class rather than a hidden class, and for unsafe anonymous class, JVM will create a new CLD, see the comment in SystemDictionary::resolve_hidden_class_from_stream:
>
> // - for unsafe anonymous class: create a new CLD whith a class holder that uses
> // the same class loader as the unsafe_anonymous_host.
> // - for hidden classes that are not strong: create a new CLD that has a class holder and
> // whose loader is the Lookup class's loader.
> // - for hidden class: add the class to the Lookup class's loader's CLD.
> Okay but we should only be concerned about the behaviour of public
> API's, so we should be testing and benchmarking those API's.
> defineAnonymousClass() maybe relevant for 11u, but not mainline.
I can use public API.
Another reason I used Unsafe API here is for saving metaspace.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3901
More information about the hotspot-dev
mailing list