8256050: JVM crashes with -XX:+PrintDeoptimizationDetails

Reviewed-by: kvn, dcubed
This commit is contained in:
Vladimir Ivanov 2020-11-10 12:41:11 +00:00
parent e6df13e6e0
commit 3455fa9bfd
7 changed files with 31 additions and 15 deletions

@ -3607,9 +3607,19 @@ void InstanceKlass::oop_print_value_on(oop obj, outputStream* st) {
st->print(" = ");
vmtarget->print_value_on(st);
} else {
java_lang_invoke_MemberName::clazz(obj)->print_value_on(st);
oop clazz = java_lang_invoke_MemberName::clazz(obj);
oop name = java_lang_invoke_MemberName::name(obj);
if (clazz != NULL) {
clazz->print_value_on(st);
} else {
st->print("NULL");
}
st->print(".");
java_lang_invoke_MemberName::name(obj)->print_value_on(st);
if (name != NULL) {
name->print_value_on(st);
} else {
st->print("NULL");
}
}
}
}

@ -28,17 +28,19 @@
#include "runtime/objectMonitor.hpp"
#include "utilities/ostream.hpp"
void markWord::print_on(outputStream* st) const {
void markWord::print_on(outputStream* st, bool print_monitor_info) const {
if (is_marked()) { // last bits = 11
st->print(" marked(" INTPTR_FORMAT ")", value());
} else if (has_monitor()) { // last bits = 10
// have to check has_monitor() before is_locked()
st->print(" monitor(" INTPTR_FORMAT ")=", value());
ObjectMonitor* mon = monitor();
if (mon == NULL) {
st->print("NULL (this should never be seen!)");
} else {
mon->print_on(st);
if (print_monitor_info) {
ObjectMonitor* mon = monitor();
if (mon == NULL) {
st->print("NULL (this should never be seen!)");
} else {
mon->print_on(st);
}
}
} else if (is_locked()) { // last bits != 01 => 00
// thin locked

@ -355,7 +355,7 @@ class markWord {
static inline markWord prototype_for_klass(const Klass* klass);
// Debugging
void print_on(outputStream* st) const;
void print_on(outputStream* st, bool print_monitor_info = true) const;
// Prepare address of oop for placement into mark
inline static markWord encode_pointer_as_mark(void* p) { return from_pointer(p).set_marked(); }

@ -23,14 +23,18 @@
*/
#include "precompiled.hpp"
#include "oops/oop.inline.hpp"
#include "runtime/basicLock.hpp"
#include "runtime/synchronizer.hpp"
void BasicLock::print_on(outputStream* st) const {
void BasicLock::print_on(outputStream* st, oop owner) const {
st->print("monitor");
markWord mark_word = displaced_header();
if (mark_word.value() != 0)
mark_word.print_on(st);
if (mark_word.value() != 0) {
// Print monitor info if there's an owning oop and it refers to this BasicLock.
bool print_monitor_info = (owner != NULL) && (owner->mark() == markWord::from_pointer((void*)this));
mark_word.print_on(st, print_monitor_info);
}
}
void BasicLock::move_to(oop obj, BasicLock* dest) {

@ -43,7 +43,7 @@ class BasicLock {
Atomic::store(&_displaced_header, header);
}
void print_on(outputStream* st) const;
void print_on(outputStream* st, oop owner) const;
// move a basic lock (used during deoptimization
void move_to(oop obj, BasicLock* dest);

@ -509,7 +509,7 @@ void frame::interpreter_frame_print_on(outputStream* st) const {
current->obj()->print_value_on(st);
st->print_cr("]");
st->print(" - lock [");
current->lock()->print_on(st);
current->lock()->print_on(st, current->obj());
st->print_cr("]");
}
// monitor

@ -669,7 +669,7 @@ void javaVFrame::print() {
}
tty->cr();
tty->print("\t ");
monitor->lock()->print_on(tty);
monitor->lock()->print_on(tty, monitor->owner());
tty->cr();
}
}