8222893: markOopDesc::print_on() is a bit confused

Add print_on for ObjectMonitor and make markOop printing sensible and add test.

Reviewed-by: dcubed, pchilanomate
This commit is contained in:
Coleen Phillimore 2019-05-06 15:25:57 -04:00
parent 69647ce061
commit 26255c10cb
5 changed files with 168 additions and 21 deletions

View file

@ -1926,3 +1926,11 @@ void ObjectMonitor::Initialize() {
DEBUG_ONLY(InitDone = true;)
}
void ObjectMonitor::print_on(outputStream* st) const {
// The minimal things to print for markOop printing, more can be added for debugging and logging.
st->print("{contentions=0x%08x,waiters=0x%08x"
",recursions=" INTPTR_FORMAT ",owner=" INTPTR_FORMAT "}",
contentions(), waiters(), recursions(),
p2i(owner()));
}