Review Request JDK-8188052: JNI_FindClass needs to specify the class loading context used for library lifecycle hooks
mandy chung
mandy.chung at oracle.com
Thu Oct 5 02:09:26 UTC 2017
On 10/4/17 5:44 PM, David Holmes wrote:
> Hi Mandy,
>
> On 5/10/2017 4:12 AM, mandy chung wrote:
>> This patch separates the JNI `FindClass` issue from the review thread
>> for JDK-8188052 [1] into a different issue.
>>
>> webrev:
>> http://cr.openjdk.java.net/~mchung/jdk10/webrevs/8188052/webrev.00/index.html
>
>
> src/hotspot/share/prims/jni.cpp
>
> Okay ... so by nulling fromClass in the classloader during
> finalization (soon to be moved to the Cleaner) you can now distinguish
> between the OnLoad case and the OnUnload case, within FindClass - a
> comment to clarify that would be good, please.
Added.
> However you still have:
>
> 407 if (loader.is_null() &&
>
> but you deleted the initialization of loader:
>
> - 404 loader = Handle(THREAD, k->class_loader());
>
> so it will by default be null. I suppose checking the loader is only a
> potential optimization as the name of the class will be uniquely
> determined anyway. But the code should be cleaned up.
>
Good catch. Yes it's an optimization to avoid making the Java call
unnecessary.
Updated:
http://cr.openjdk.java.net/~mchung/jdk10/webrevs/8188052/webrev.01/src/hotspot/share/prims/jni.cpp.sdiff.html
Mandy
More information about the core-libs-dev
mailing list