RFR: 8266642: improve ResolvedMethodTable hash function [v2]

David Holmes david.holmes at oracle.com
Tue May 11 02:52:19 UTC 2021


On 11/05/2021 12:37 pm, Denghui Dong wrote:
> On Tue, 11 May 2021 00:27:47 GMT, David Holmes <dholmes at openjdk.org> wrote:
> 
>>> Because here needs different class loader data to load the different classes with the same name, I think Unsafe API is a simple way to achieve this purpose.
>>
>> 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.

Thanks,
David

> -------------
> 
> PR: https://git.openjdk.java.net/jdk/pull/3901
> 


More information about the hotspot-runtime-dev mailing list