RFR: 8266642: improve ResolvedMethodTable hash function [v2]
Denghui Dong
ddong at openjdk.java.net
Mon May 10 17:43:56 UTC 2021
On Mon, 10 May 2021 05:40:50 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> Denghui Dong has updated the pull request incrementally with one additional commit since the last revision:
>>
>> minor adjustment
>
> test/hotspot/jtreg/runtime/MemberName/ResolvedMethodTableHash.java line 57:
>
>> 55: byte[] buf = new byte[100];
>> 56: int size = writeClass(buf, "MH$$");
>> 57: Class<?> cls = Unsafe.getUnsafe().defineAnonymousClass(ResolvedMethodTableHash.class, Arrays.copyOf(buf, size), null);
>
> Why do we need to use Unsafe for this rather the public Lookup.defineHiddenClass API?
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.
-------------
PR: https://git.openjdk.java.net/jdk/pull/3901
More information about the hotspot-dev
mailing list