RFR: 8318462: [GenShen] Prevent unsafe access to displaced mark-word [v3]

Kelvin Nilsen kdnilsen at openjdk.org
Tue Oct 31 16:20:28 UTC 2023


On Thu, 26 Oct 2023 16:25:05 GMT, Kelvin Nilsen <kdnilsen at openjdk.org> wrote:

>> src/hotspot/share/gc/shenandoah/shenandoahMark.inline.hpp line 123:
>> 
>>> 121:       assert(region->is_young(), "Only for young objects");
>>> 122:       uint age = ShenandoahHeap::get_object_age(obj);
>>> 123:       CENSUS_NOISE(heap->age_census()->add(age, region->age(), region->youth(), size, worker_id);)
>> 
>> I'm thinking if get_object_age() returns max_age+1, the CENSUS_NOISE macros might end up with invalid data.  Don't we need a check here?
>
> I think the safe thing to do is treat max_age+1 as if it were 0, insofar as promotion semantics is concerned.  We may delay promotion that way.

Thanks for change.  Code might read easier with parens around (age == markWord::max_age + 1), but ok as is.

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

PR Review Comment: https://git.openjdk.org/shenandoah/pull/343#discussion_r1377851974


More information about the shenandoah-dev mailing list