The issue is discussed in the following PR comments:
https://github.com/openjdk/jdk/pull/20677#discussion_r1731866842
In summary, the _mark field not only contains bits of interest (and thus should be printed as an int), but also is how you get to the Klass*, thus should be printed as a class name. When not using Compact Object Headers, currently we see this from the clhsdb inspect command:
hsdb> + inspect 0x00000007cff154b8
instance of Oop for java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject @ 0x00000007cff154b8 (size = 24)
_mark: 1
_metadata._compressed_klass: InstanceKlass for java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject
firstWaiter: Oop for java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionNode @ 0x00000007cfff5f80
lastWaiter: Oop for java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionNode @ 0x00000007cfff5f80
this$0: Oop for java/util/concurrent/locks/ReentrantLock$NonfairSync @ 0x00000007cff15498
Notice the presence of both the _mark field and also the _metadata._compressed_klass field expanding to the class name. With Compressed Object headers we only see the _mark field:
_mark: 16294762323640321
From the PR discussion:
"Thinking about this a bit more, maybe _mark needs to be a MetadataField rather than CInt. This is a kind of odd situation. Basically we have a CInt field that is more than just simple bits used as flags or small integers. It also gets you to the Klass*. Possibly SA should treat _mark is two separate fields; one that remains a CInt as it currently is and another that treats it as an encoded Klass* like the NarrowKlassField case."
https://github.com/openjdk/jdk/pull/20677#discussion_r1731866842
In summary, the _mark field not only contains bits of interest (and thus should be printed as an int), but also is how you get to the Klass*, thus should be printed as a class name. When not using Compact Object Headers, currently we see this from the clhsdb inspect command:
hsdb> + inspect 0x00000007cff154b8
instance of Oop for java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject @ 0x00000007cff154b8 (size = 24)
_mark: 1
_metadata._compressed_klass: InstanceKlass for java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionObject
firstWaiter: Oop for java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionNode @ 0x00000007cfff5f80
lastWaiter: Oop for java/util/concurrent/locks/AbstractQueuedSynchronizer$ConditionNode @ 0x00000007cfff5f80
this$0: Oop for java/util/concurrent/locks/ReentrantLock$NonfairSync @ 0x00000007cff15498
Notice the presence of both the _mark field and also the _metadata._compressed_klass field expanding to the class name. With Compressed Object headers we only see the _mark field:
_mark: 16294762323640321
From the PR discussion:
"Thinking about this a bit more, maybe _mark needs to be a MetadataField rather than CInt. This is a kind of odd situation. Basically we have a CInt field that is more than just simple bits used as flags or small integers. It also gets you to the Klass*. Possibly SA should treat _mark is two separate fields; one that remains a CInt as it currently is and another that treats it as an encoded Klass* like the NarrowKlassField case."
- is blocked by
-
JDK-8305895 Implement JEP 450: Compact Object Headers (Experimental)
- Resolved