RFR: 8261268: LOAD_INSTANCE placeholders unneeded for parallelCapable class loaders

Coleen Phillimore coleenp at openjdk.java.net
Tue Feb 9 12:33:30 UTC 2021


On Tue, 9 Feb 2021 02:43:34 GMT, David Holmes <dholmes at openjdk.org> wrote:

>> See CR for more details.  This optimizes some code for class loading.
>> Tested with tier1-6.
>
> src/hotspot/share/classfile/systemDictionary.cpp line 594:
> 
>> 592:   // and has not yet finished.
>> 593:   // In both cases the original caller will clean up the placeholder
>> 594:   // entry on error.
> 
> Is this commentary really no longer applicable? While I don't fully understand it it does indicate the general conditions under which we will call handle_parallel_super_load.

I'm in progress of investigating why this code exists.   The last two lines were false, and these lines seem to repeat the comments above handle_parallel_super_load.  Pointing out java.lang.instrument is even more befuddling.  There may have been a case once where two threads tried to load the same class in RedefineClasses.  I'm not sure why the LOAD_INSTANCE wouldn't have stopped them, just like it stops all classes from being duplicate loaded.  In any case, today RedefineClasses now locks loading the same class with the RedefineClasses_lock.

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

PR: https://git.openjdk.java.net/jdk/pull/2469


More information about the hotspot-runtime-dev mailing list