RFR(S) 8148944: CollectorPolicy methods for memory allocations are specific to GenCollectorPolicy

Mikael Gerdin mikael.gerdin at oracle.com
Thu Feb 4 07:31:41 UTC 2016


Hi Kim,

On 2016-02-03 21:20, Kim Barrett wrote:
>> On Feb 3, 2016, at 1:40 PM, Mikael Gerdin <mikael.gerdin at oracle.com> wrote:
>>
>> Hi,
>>
>> Please review this small cleanup to reduce the public API of CollectorPolicy.
>>
>> CollectorPolicy::mem_allocate_work and satisfy_failed_allocation are pure virtuals on CollectorPolicy but are only used by GenCollectorPolicy/GenCollectedHeap. The other collectors stub the methods out with fatal errors if they are called.
>>
>> My fix is to move the methods to GenCollectorPolicy and let GenCollectedHeap access them through its typed pointer to the Gen policy.
>>
>> I've also taken the opportunity to remove the "virtual" keyword from satsfy_failed_metadata_allocation(), it has never been overridden by any CollectorPolicy subclass. If that is desirable then it can easily be reinstated.
>>
>> Bug: https://bugs.openjdk.java.net/browse/JDK-8148944
>> Webrev: http://cr.openjdk.java.net/~mgerdin/8148944/webrev.0/
>> Testing: Just a local build and testing with GCBasher.
>>
>> Thanks
>> /Mikael
>
> Looks good.
>
> A couple minor comments; don't need a new webrev for these.
>
> ------------------------------------------------------------------------------
>
> Update copyrights.

Will do.

>
> ------------------------------------------------------------------------------
> src/share/vm/gc/shared/collectorPolicy.hpp
> Update indentation of parameters for satisfy_failed_metadata_allocation.
> [Unless webrev isn't showing me the whitespace-only changes.]

I hadn't fixed the parameter alignment here, good catch!

Thanks for the review.

/Mikael

>
> ------------------------------------------------------------------------------
>



More information about the hotspot-gc-dev mailing list