RFR: 8259068: Streamline class loader locking

Coleen Phillimore coleenp at openjdk.java.net
Fri Jan 15 00:08:07 UTC 2021


On Thu, 14 Jan 2021 23:37:47 GMT, Coleen Phillimore <coleenp at openjdk.org> wrote:

>> src/hotspot/share/classfile/systemDictionary.cpp line 1635:
>> 
>>> 1633:   HandleMark hm(THREAD);
>>> 1634:   ClassLoaderData* loader_data = k->class_loader_data();
>>> 1635:   assert(loader_data->class_loader() == class_loader(), "they are the same");
>> 
>> What's the reason for adding a class_loader parameter? Is it to avoid creating a new Handle?
>> If there's not much performance difference, I would suggest keeping the old code to avoid code churn.
>
> I added it to prevent a read barrier for GC, since I have the value in all the callers and to prevent creating another handle, which I also have in all the callers.

If I pass class_loader, this function doesn't need a HandleMark either.

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

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


More information about the hotspot-dev mailing list