Skip to content
This repository was archived by the owner on Sep 2, 2022. It is now read-only.

Commit 1f556d2

Browse files
author
Tom Rodriguez
committed
8258380: [JVMCI] don't clear InstalledCode reference when unloading JVMCI nmethods
Reviewed-by: kvn, eosterlund
1 parent e7aa5fe commit 1f556d2

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

src/hotspot/share/code/nmethod.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1270,7 +1270,6 @@ void nmethod::make_unloaded() {
12701270
JVMCINMethodData* nmethod_data = jvmci_nmethod_data();
12711271
if (nmethod_data != NULL) {
12721272
nmethod_data->invalidate_nmethod_mirror(this);
1273-
nmethod_data->clear_nmethod_mirror(this);
12741273
}
12751274
#endif
12761275
}

src/hotspot/share/jvmci/jvmciRuntime.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -714,6 +714,12 @@ void JVMCINMethodData::invalidate_nmethod_mirror(nmethod* nm) {
714714
HotSpotJVMCI::InstalledCode::set_entryPoint(jvmciEnv, nmethod_mirror, 0);
715715
}
716716
}
717+
718+
if (_nmethod_mirror_index != -1 && nm->is_unloaded()) {
719+
// Drop the reference to the nmethod mirror object but don't clear the actual oop reference. Otherwise
720+
// it would appear that the nmethod didn't need to be unloaded in the first place.
721+
_nmethod_mirror_index = -1;
722+
}
717723
}
718724

719725
JVMCIRuntime::JVMCIRuntime(int id) {

0 commit comments

Comments
 (0)