src/share/vm/code/nmethod.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File
8048721 Cdiff src/share/vm/code/nmethod.cpp
src/share/vm/code/nmethod.cpp
Print this page
*** 956,973 ****
#undef LOG_OFFSET
// Print out more verbose output usually for a newly created nmethod.
! void nmethod::print_on(outputStream* st, const char* msg) const {
if (st != NULL) {
ttyLocker ttyl;
if (WizardMode) {
! CompileTask::print_compilation(st, this, msg, /*short_form:*/ true);
st->print_cr(" (" INTPTR_FORMAT ")", this);
} else {
! CompileTask::print_compilation(st, this, msg, /*short_form:*/ false);
}
}
}
--- 956,973 ----
#undef LOG_OFFSET
// Print out more verbose output usually for a newly created nmethod.
! void nmethod::print_on(outputStream* st, const char* msg, int entry_bci) const {
if (st != NULL) {
ttyLocker ttyl;
if (WizardMode) {
! CompileTask::print_compilation(st, this, entry_bci, msg, /*short_form:*/ true);
st->print_cr(" (" INTPTR_FORMAT ")", this);
} else {
! CompileTask::print_compilation(st, this, entry_bci, msg, /*short_form:*/ false);
}
}
}
*** 1267,1277 ****
method()->method_holder()->remove_osr_nmethod(this);
// Set entry as invalid
_entry_bci = InvalidOSREntryBci;
}
! void nmethod::log_state_change() const {
if (LogCompilation) {
if (xtty != NULL) {
ttyLocker ttyl; // keep the following output all in one block
if (_state == unloaded) {
xtty->begin_elem("make_unloaded thread='" UINTX_FORMAT "'",
--- 1267,1277 ----
method()->method_holder()->remove_osr_nmethod(this);
// Set entry as invalid
_entry_bci = InvalidOSREntryBci;
}
! void nmethod::log_state_change(int entry_bci) const {
if (LogCompilation) {
if (xtty != NULL) {
ttyLocker ttyl; // keep the following output all in one block
if (_state == unloaded) {
xtty->begin_elem("make_unloaded thread='" UINTX_FORMAT "'",
*** 1285,1295 ****
xtty->stamp();
xtty->end_elem();
}
}
if (PrintCompilation && _state != unloaded) {
! print_on(tty, _state == zombie ? "made zombie" : "made not entrant");
}
}
/**
* Common functionality for both make_not_entrant and make_zombie
--- 1285,1295 ----
xtty->stamp();
xtty->end_elem();
}
}
if (PrintCompilation && _state != unloaded) {
! print_on(tty, _state == zombie ? "made zombie" : "made not entrant", entry_bci);
}
}
/**
* Common functionality for both make_not_entrant and make_zombie
*** 1313,1322 ****
--- 1313,1324 ----
{
// invalidate osr nmethod before acquiring the patching lock since
// they both acquire leaf locks and we don't want a deadlock.
// This logic is equivalent to the logic below for patching the
// verified entry point of regular methods.
+ // Save entry bci for logging before invalidating the index.
+ int entry_bci = _entry_bci;
if (is_osr_method()) {
// this effectively makes the osr nmethod not entrant
invalidate_osr_method();
}
*** 1359,1370 ****
}
// Change state
_state = state;
! // Log the transition once
! log_state_change();
// Remove nmethod from method.
// We need to check if both the _code and _from_compiled_code_entry_point
// refer to this nmethod because there is a race in setting these two fields
// in Method* as seen in bugid 4947125.
--- 1361,1372 ----
}
// Change state
_state = state;
! // Log the transition once (print saved entry bci for osr nmethods)
! log_state_change(entry_bci);
// Remove nmethod from method.
// We need to check if both the _code and _from_compiled_code_entry_point
// refer to this nmethod because there is a race in setting these two fields
// in Method* as seen in bugid 4947125.
src/share/vm/code/nmethod.cpp
Index
Unified diffs
Context diffs
Sdiffs
Patch
New
Old
Previous File
Next File