Skip to content
This repository has been archived by the owner on Sep 2, 2022. It is now read-only.
/ jdk16 Public archive

8258380: [JVMCI] don't clear InstalledCode reference when unloading JVMCI nmethods #25

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
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
1 change: 0 additions & 1 deletion src/hotspot/share/code/nmethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1270,7 +1270,6 @@ void nmethod::make_unloaded() {
JVMCINMethodData* nmethod_data = jvmci_nmethod_data();
if (nmethod_data != NULL) {
nmethod_data->invalidate_nmethod_mirror(this);
nmethod_data->clear_nmethod_mirror(this);
}
#endif
}
Expand Down
6 changes: 6 additions & 0 deletions src/hotspot/share/jvmci/jvmciRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -714,6 +714,12 @@ void JVMCINMethodData::invalidate_nmethod_mirror(nmethod* nm) {
HotSpotJVMCI::InstalledCode::set_entryPoint(jvmciEnv, nmethod_mirror, 0);
}
}

if (_nmethod_mirror_index != -1 && nm->is_unloaded()) {
// Drop the reference to the nmethod mirror object but don't clear the actual oop reference. Otherwise
// it would appear that the nmethod didn't need to be unloaded in the first place.
_nmethod_mirror_index = -1;
}
}

JVMCIRuntime::JVMCIRuntime(int id) {
Expand Down