RFR: 8329658: Serial: Refactor ContiguousSpace::_next_compaction_space

Albert Mingkun Yang ayang at openjdk.org
Mon Apr 8 08:15:09 UTC 2024


On Sat, 6 Apr 2024 08:22:47 GMT, Guoxiong Li <gli at openjdk.org> wrote:

> Hi all,
> 
> This patch removes the uncessary `ContiguousSpace::_next_compaction_space` and uses `DefNewGeneration::_promotion_failed` instead.
> 
> The tests `make test-tier1_gc` passed locally.
> 
> Thanks for taking the time to review.
> 
> Best Regards,
> -- Guoxiong

src/hotspot/share/gc/serial/serialFullGC.cpp line 268:

> 266:     _spaces[2].init(heap->young_gen()->from());
> 267: 
> 268:     if (heap->young_gen()->promotion_failed()) {

Can we check `to()->is_empty()` here? `promotion_failed` is private and should probably stay private, IMO. `SerialHeap::incremental_collection_failed` would have been appropriate, but that API appears to be abused, `heap->set_incremental_collection_failed(); // Slight lie: we did not even attempt one`

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

PR Review Comment: https://git.openjdk.org/jdk/pull/18666#discussion_r1554563621


More information about the hotspot-gc-dev mailing list