mirror of
https://github.com/openjdk/jdk.git
synced 2025-08-28 15:24:43 +02:00
8150084: Convert TraceMonitorMismatch to Unified Logging
TraceMonitorMismatch has been converted to Unified Logging. Reviewed-by: coleenp, rprotacio
This commit is contained in:
parent
cd3f80324f
commit
45b8dc27fe
6 changed files with 190 additions and 15 deletions
|
@ -24,6 +24,7 @@
|
|||
|
||||
#include "precompiled.hpp"
|
||||
#include "interpreter/bytecodeStream.hpp"
|
||||
#include "logging/log.hpp"
|
||||
#include "oops/generateOopMap.hpp"
|
||||
#include "oops/oop.inline.hpp"
|
||||
#include "oops/symbol.hpp"
|
||||
|
@ -32,6 +33,7 @@
|
|||
#include "runtime/relocator.hpp"
|
||||
#include "runtime/timerTrace.hpp"
|
||||
#include "utilities/bitMap.inline.hpp"
|
||||
#include "utilities/ostream.hpp"
|
||||
#include "prims/methodHandles.hpp"
|
||||
|
||||
//
|
||||
|
@ -787,7 +789,7 @@ void GenerateOopMap::merge_state_into_bb(BasicBlock *bb) {
|
|||
bb->set_changed(true);
|
||||
}
|
||||
} else {
|
||||
if (TraceMonitorMismatch) {
|
||||
if (log_is_enabled(Info, monitormismatch)) {
|
||||
report_monitor_mismatch("monitor stack height merge conflict");
|
||||
}
|
||||
// When the monitor stacks are not matched, we set _monitor_top to
|
||||
|
@ -856,7 +858,7 @@ CellTypeState GenerateOopMap::monitor_pop() {
|
|||
_monitor_safe = false;
|
||||
_monitor_top = bad_monitors;
|
||||
|
||||
if (TraceMonitorMismatch) {
|
||||
if (log_is_enabled(Info, monitormismatch)) {
|
||||
report_monitor_mismatch("monitor stack underflow");
|
||||
}
|
||||
return CellTypeState::ref; // just to keep the analysis going.
|
||||
|
@ -872,7 +874,7 @@ void GenerateOopMap::monitor_push(CellTypeState cts) {
|
|||
_monitor_safe = false;
|
||||
_monitor_top = bad_monitors;
|
||||
|
||||
if (TraceMonitorMismatch) {
|
||||
if (log_is_enabled(Info, monitormismatch)) {
|
||||
report_monitor_mismatch("monitor stack overflow");
|
||||
}
|
||||
return;
|
||||
|
@ -1245,7 +1247,7 @@ void GenerateOopMap::do_exception_edge(BytecodeStream* itr) {
|
|||
// We don't set _monitor_top to bad_monitors because there are no successors
|
||||
// to this exceptional exit.
|
||||
|
||||
if (TraceMonitorMismatch && _monitor_safe) {
|
||||
if (log_is_enabled(Info, monitormismatch) && _monitor_safe) {
|
||||
// We check _monitor_safe so that we only report the first mismatched
|
||||
// exceptional exit.
|
||||
report_monitor_mismatch("non-empty monitor stack at exceptional exit");
|
||||
|
@ -1255,11 +1257,11 @@ void GenerateOopMap::do_exception_edge(BytecodeStream* itr) {
|
|||
}
|
||||
|
||||
void GenerateOopMap::report_monitor_mismatch(const char *msg) {
|
||||
#ifndef PRODUCT
|
||||
tty->print(" Monitor mismatch in method ");
|
||||
method()->print_short_name(tty);
|
||||
tty->print_cr(": %s", msg);
|
||||
#endif
|
||||
ResourceMark rm;
|
||||
outputStream* out = LogHandle(monitormismatch)::info_stream();
|
||||
out->print("Monitor mismatch in method ");
|
||||
method()->print_short_name(out);
|
||||
out->print_cr(": %s", msg);
|
||||
}
|
||||
|
||||
void GenerateOopMap::print_states(outputStream *os,
|
||||
|
@ -1782,7 +1784,7 @@ void GenerateOopMap::do_monitorenter(int bci) {
|
|||
_monitor_top = bad_monitors;
|
||||
_monitor_safe = false;
|
||||
|
||||
if (TraceMonitorMismatch) {
|
||||
if (log_is_enabled(Info, monitormismatch)) {
|
||||
report_monitor_mismatch("nested redundant lock -- bailout...");
|
||||
}
|
||||
return;
|
||||
|
@ -1820,7 +1822,7 @@ void GenerateOopMap::do_monitorexit(int bci) {
|
|||
bb->set_changed(true);
|
||||
bb->_monitor_top = bad_monitors;
|
||||
|
||||
if (TraceMonitorMismatch) {
|
||||
if (log_is_enabled(Info, monitormismatch)) {
|
||||
report_monitor_mismatch("improper monitor pair");
|
||||
}
|
||||
} else {
|
||||
|
@ -1846,7 +1848,7 @@ void GenerateOopMap::do_return_monitor_check() {
|
|||
// Since there are no successors to the *return bytecode, it
|
||||
// isn't necessary to set _monitor_top to bad_monitors.
|
||||
|
||||
if (TraceMonitorMismatch) {
|
||||
if (log_is_enabled(Info, monitormismatch)) {
|
||||
report_monitor_mismatch("non-empty monitor stack at return");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue