RFR: 8367339: Parallel: Remove PSScavenge::should_scavenge

Francesco Andreuzzi fandreuzzi at openjdk.org
Wed Sep 10 21:01:56 UTC 2025


On Wed, 10 Sep 2025 14:03:20 GMT, Albert Mingkun Yang <ayang at openjdk.org> wrote:

> Removing (inlining) a compound method that performs two independent things, loading the obj from a location and checking whether the object belongs to young-gen. Existing callers are changed to use more fine-grained methods, which are more transparent and readable in their context.
> 
> Test: tier1-3

src/hotspot/share/gc/parallel/psPromotionManager.inline.hpp line 337:

> 335: inline void PSPromotionManager::copy_and_push_safe_barrier(T* p) {
> 336:   assert(ParallelScavengeHeap::heap()->is_in_reserved(p), "precondition");
> 337:   assert(should_scavenge(p, true), "revisiting object?");

This method is `public`, is it safe to remove the assertion?

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

PR Review Comment: https://git.openjdk.org/jdk/pull/27193#discussion_r2337901467


More information about the hotspot-gc-dev mailing list