RFR: 8217450: Add PackageEntry::locked_lookup_only

Lois Foltan lois.foltan at oracle.com
Tue Jan 22 17:10:38 UTC 2019


On 1/22/2019 11:32 AM, Lois Foltan wrote:
>
>
> On 1/22/2019 10:21 AM, Claes Redestad wrote:
>>
>>
>> On 2019-01-22 16:11, Aleksey Shipilev wrote:
>>> Mmm. Compilers might complain we do not use the returned value? I 
>>> think the previous way made a bit
>>> more sense, and was a bit faster. Just move the local variable 
>>> declaration?
>>
>> Ok - updated http://cr.openjdk.java.net/~redestad/8217450/open.01/ in
>> place and running some sanity tests before push.
>>
>> Thanks!
>>
>> /Claes
>
> Hi Claes,
>
> The code change in modules.cpp lines #211-214 does not look correct.  
> PackageEntry::locked_create_entry_or_null() will return NULL if the 
> package exists and has already been created.  The code at lines 
> #211-214 need a PackageEntry to be successfully returned for java.base 
> packages created during bootstrapping so we can decrement the refcount 
> for it appropriately.

Just to clarify further.  Obtaining a PackageEntry itself is not a 
requirement for decrementing the refcount of the Symbol* within the 
table.  However, the assert at line #213 will trigger if 
PackageEntry::locked_create_entry_or_null() returns NULL for an existing 
package.  A PackageEntry can be created for any class loaded, such as 
java/lang/Class and java/lang/Object for example, during bootstrapping 
before java.base is defined to the JVM.  These classes are put on a  
fixup_module_list so that once the java.base module is defined the JVM 
can then fixup their java.lang.Module field to be correctly set to 
java.base.

Thanks,
Lois

>
> Thanks,
> Lois



More information about the hotspot-runtime-dev mailing list