On Mon, 24 Aug 2026 07:03:22 GMT, Axel Boldt-Christmas <[email protected]>
wrote:
>> src/hotspot/share/oops/markWord.cpp line 40:
>>
>>> 38: // have to check has_monitor() before is_locked()
>>> 39: // Valhalla: inline types/arrays can't be monitored
>>> 40: st->print(" monitor(" INTPTR_FORMAT ")", value());
>>
>> But the monitor isn't the value now. Shouldn't this just be removed? We
>> don't want printing to search the table.
>
> I think this whole method could use some cleanup. This just prints the value
> of the markWord (same as before) but it did so because it did not want to go
> chasing displaced marked words. Similarly the `is_locked` leg did not want to
> go chase stack locks.
>
> Neither exists anymore. It is really only the GC that displaces/preservers
> the markWord in a STW collection because of forwarding pointers. So we should
> clean this up to be if marked just print the value, else actually print some
> more state.
>
> Similarly we should clean up the valhalla invariants now that we do not
> displace markWords.
I think this else clause should be removed from printing first though, with
this change.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/32471#discussion_r3846573624