Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/hotspot/share/c1/c1_Runtime1.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1340,7 +1340,7 @@ void Runtime1::patch_code(JavaThread* current, C1StubId stub_id) {
// Make sure the nmethod is invalidated, i.e. made not entrant.
nmethod* nm = CodeCache::find_nmethod(caller_frame.pc());
if (nm != nullptr) {
nm->make_not_entrant(nmethod::NMethodChangeReason::C1_deoptimize_for_patching);
nm->make_not_entrant(nmethod::ChangeReason::C1_deoptimize_for_patching);
}
}

Expand Down
75 changes: 49 additions & 26 deletions src/hotspot/share/code/nmethod.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -497,31 +497,54 @@ class nmethod : public CodeBlob {

static const char* change_reason_to_string(ChangeReason change_reason) {
switch (change_reason) {
case ChangeReason::C1_codepatch: return "C1 code patch";
case ChangeReason::C1_deoptimize: return "C1 deoptimized";
case ChangeReason::C1_deoptimize_for_patching: return "C1 deoptimize for patching";
case ChangeReason::C1_predicate_failed_trap: return "C1 predicate failed trap";
case ChangeReason::CI_replay: return "CI replay";
case ChangeReason::JVMCI_invalidate_nmethod: return "JVMCI invalidate nmethod";
case ChangeReason::JVMCI_invalidate_nmethod_mirror: return "JVMCI invalidate nmethod mirror";
case ChangeReason::JVMCI_materialize_virtual_object: return "JVMCI materialize virtual object";
case ChangeReason::JVMCI_new_installation: return "JVMCI new installation";
case ChangeReason::JVMCI_register_method: return "JVMCI register method";
case ChangeReason::JVMCI_replacing_with_new_code: return "JVMCI replacing with new code";
case ChangeReason::JVMCI_reprofile: return "JVMCI reprofile";
case ChangeReason::marked_for_deoptimization: return "marked for deoptimization";
case ChangeReason::missing_exception_handler: return "missing exception handler";
case ChangeReason::not_used: return "not used";
case ChangeReason::OSR_invalidation_back_branch: return "OSR invalidation back branch";
case ChangeReason::OSR_invalidation_for_compiling_with_C1: return "OSR invalidation for compiling with C1";
case ChangeReason::OSR_invalidation_of_lower_level: return "OSR invalidation of lower level";
case ChangeReason::set_native_function: return "set native function";
case ChangeReason::uncommon_trap: return "uncommon trap";
case ChangeReason::whitebox_deoptimization: return "whitebox deoptimization";
case ChangeReason::zombie: return "zombie";
default:
assert(false, "Unhandled reason");
return "Unknown";
case ChangeReason::C1_codepatch:
return "C1 code patch";
case ChangeReason::C1_deoptimize:
return "C1 deoptimized";
case ChangeReason::C1_deoptimize_for_patching:
return "C1 deoptimize for patching";
case ChangeReason::C1_predicate_failed_trap:
return "C1 predicate failed trap";
case ChangeReason::CI_replay:
return "CI replay";
case ChangeReason::JVMCI_invalidate_nmethod:
return "JVMCI invalidate nmethod";
case ChangeReason::JVMCI_invalidate_nmethod_mirror:
return "JVMCI invalidate nmethod mirror";
case ChangeReason::JVMCI_materialize_virtual_object:
return "JVMCI materialize virtual object";
case ChangeReason::JVMCI_new_installation:
return "JVMCI new installation";
case ChangeReason::JVMCI_register_method:
return "JVMCI register method";
case ChangeReason::JVMCI_replacing_with_new_code:
return "JVMCI replacing with new code";
case ChangeReason::JVMCI_reprofile:
return "JVMCI reprofile";
case ChangeReason::marked_for_deoptimization:
return "marked for deoptimization";
case ChangeReason::missing_exception_handler:
return "missing exception handler";
case ChangeReason::not_used:
return "not used";
case ChangeReason::OSR_invalidation_back_branch:
return "OSR invalidation back branch";
case ChangeReason::OSR_invalidation_for_compiling_with_C1:
return "OSR invalidation for compiling with C1";
case ChangeReason::OSR_invalidation_of_lower_level:
return "OSR invalidation of lower level";
case ChangeReason::set_native_function:
return "set native function";
case ChangeReason::uncommon_trap:
return "uncommon trap";
case ChangeReason::whitebox_deoptimization:
return "whitebox deoptimization";
case ChangeReason::zombie:
return "zombie";
default: {
assert(false, "Unhandled reason");
return "Unknown";
}
}
}

Expand Down Expand Up @@ -688,7 +711,7 @@ class nmethod : public CodeBlob {
// if this thread changed the state of the nmethod or false if
// another thread performed the transition.
bool make_not_entrant(ChangeReason change_reason);
bool make_not_used() { return make_not_entrant(ChangeReason::not_used); }
bool make_not_used() { return make_not_entrant(ChangeReason::not_used); }

bool is_marked_for_deoptimization() const { return deoptimization_status() != not_marked; }
bool has_been_deoptimized() const { return deoptimization_status() == deoptimize_done; }
Expand Down