RFR: 8367339: Parallel: Remove PSScavenge::should_scavenge
Albert Mingkun Yang
ayang at openjdk.org
Thu Sep 11 08:51:02 UTC 2025
On Wed, 10 Sep 2025 20:59:16 GMT, Francesco Andreuzzi <fandreuzzi 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?
The same assert is repeated inside `PSPromotionManager::copy_to_survivor_space`, which is called a few lines below, so I removed this one.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27193#discussion_r2339514817
More information about the hotspot-gc-dev
mailing list