RFR: 8280136: Serial: Remove unnecessary use of ExpandHeap_lock [v4]

Stefan Johansson sjohanss at openjdk.java.net
Fri Feb 11 10:42:09 UTC 2022


On Thu, 10 Feb 2022 17:23:42 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

>> This PR consists of two commits:
>> 
>> 1. remove `ExpandHeap_lock` in Serial GC code.
>> 2. rename it to `ParallelExpandHeap_lock` to indicate it's Parallel-GC only.
>> 
>> Test: tier1-6
>
> Albert Mingkun Yang has updated the pull request incrementally with one additional commit since the last revision:
> 
>   lower case

Looks good, even if I preferred the old use of `needs_expand()`.

src/hotspot/share/gc/parallel/psOldGen.cpp line 180:

> 178:     bool needs_expand =
> 179:       pointer_delta(object_space()->end(), object_space()->top()) < word_size;
> 180:     if (needs_expand) {

To me the old code reads better, but I guess it's a matter of taste. The predicate could be moved to PSOldGen to allow asserting that the lock is held.

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

Marked as reviewed by sjohanss (Reviewer).

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


More information about the hotspot-dev mailing list