RFR(S) 8210864 Reduce the use of metaspaceShared.hpp

Lois Foltan lois.foltan at oracle.com
Tue Sep 18 20:52:57 UTC 2018


On 9/18/2018 1:44 PM, Ioi Lam wrote:

>
>
> On 9/18/18 10:19 AM, Lois Foltan wrote:
>> On 9/18/2018 1:03 PM, Ioi Lam wrote:
>>
>>> https://bugs.openjdk.java.net/browse/JDK-8210864
>>> http://cr.openjdk.java.net/~iklam/jdk12/8210864-reduce-metaspaceShared-hpp-include.v01/ 
>>>
>>>
>>> I really hate it whenever I edit metaspaceShared.hpp I have to
>>> rebuild almost every source file in HotSpot. That's due to this
>>> usage in the popular header file oop.inline.hpp:
>>>
>>>     void oopDesc::forward_to(oop p) {
>>>       ...
>>>       assert(!MetaspaceShared::is_archive_object(oop(this)) &&
>>>              !MetaspaceShared::is_archive_object(p),
>>>              "forwarding archive object");
>>>
>>>
>>> The fix is to change the call to oopDesc::is_archive_object() which is
>>> defined out-of-line.
>>>
>>> With this change, the number of dependent .o files reduced from 500+ to
>>> 45.
>>>
>>> I added metaspaceShared.inline.hpp so oopDesc::forward_to should be
>>> as fast as before, and all other callers of 
>>> MetaspaceShared::is_archive_object
>>> should be a little faster (probably not measurable).
>>>
>>> I also removed a few unnecessary includes of metaspaceShared.hpp
>>>
>>> Thanks
>>> - Ioi
>> Looks good.  One minor comment:
>>
>> Within src/share/memory/metaspaceShared.inline.hpp, can the method 
>> is_archive_object be placed in PRODUCT conditional code like it is in 
>> src/share/oops/oopsDesc.cpp?
>>
> Hi Lois,
>
> Thanks for the review.
>
> I couldn't exclude MetaspaceShared::is_archive_object from product 
> builds because it's used in the method initialize_static_field in 
> javaClasses.cpp.

Got it, thanks!
Lois

>
> Thanks
> - Ioi
>
>> Thanks,
>> Lois
>



More information about the hotspot-runtime-dev mailing list