RFR: 8374145: Remove legacy locking remnants from markWord

Stefan Karlsson stefank at openjdk.org
Fri Dec 19 14:30:07 UTC 2025


On Fri, 19 Dec 2025 14:10:24 GMT, Axel Boldt-Christmas <aboldtch at openjdk.org> wrote:

>> There's a bunch of unused code in markWord that used to be used by the removed legacy locking. I propose that we remove it.
>> 
>> There's a Shenandoah change that should be checked closer. My thinking is:
>>  `is_being_inflated`: always returns false
>>  `has_displaced_mark_helper`: Only returns true if both these are true:
>>    * `!UseCompactObjectTable` - there's an early return for this earlier in the function.
>>    * `lockbits == monitor_value` - checked in the if-statement above
>
> src/hotspot/share/gc/shenandoah/shenandoahHeap.inline.hpp line 349:
> 
>> 347:   } else if (w.is_being_inflated() || w.has_displaced_mark_helper()) {
>> 348:     // Informs caller that we aren't able to determine the age
>> 349:     return markWord::max_age + 1; // sentinel
> 
> Not sure if we want an `!w.has_displaced_mark_helper()` assert. Even if we already check  for (and handled) the exact conditions (in the current implementation) for `has_displaced_mark_helper()`.

That would work for me. I'll wait for input from the Shenandoah devs.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/28927#discussion_r2635237702


More information about the shenandoah-dev mailing list