Skip to content
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
6 changes: 3 additions & 3 deletions src/hotspot/share/jvmci/jvmciCompilerToVM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2779,11 +2779,11 @@ C2V_VMENTRY_0(jlong, translate, (JNIEnv* env, jobject, jobject obj_handle, jbool
} else {
// Link the new HotSpotNmethod to the nmethod
PEER_JVMCIENV->initialize_installed_code(result, nm, JVMCI_CHECK_0);
// Only HotSpotNmethod instances in the HotSpot heap are tracked directly by the runtime.
if (PEER_JVMCIENV->is_hotspot()) {
// Only non-default HotSpotNmethod instances in the HotSpot heap are tracked directly by the runtime.
if (!isDefault && PEER_JVMCIENV->is_hotspot()) {
JVMCINMethodData* data = nm->jvmci_nmethod_data();
if (data == nullptr) {
JVMCI_THROW_MSG_0(IllegalArgumentException, "Cannot set HotSpotNmethod mirror for default nmethod");
JVMCI_THROW_MSG_0(IllegalArgumentException, "Missing HotSpotNmethod data");
}
if (data->get_nmethod_mirror(nm, /* phantom_ref */ false) != nullptr) {
JVMCI_THROW_MSG_0(IllegalArgumentException, "Cannot overwrite existing HotSpotNmethod mirror for nmethod");
Expand Down
6 changes: 3 additions & 3 deletions src/hotspot/share/jvmci/jvmciRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -824,10 +824,10 @@ oop JVMCINMethodData::get_nmethod_mirror(nmethod* nm, bool phantom_ref) {
}

void JVMCINMethodData::set_nmethod_mirror(nmethod* nm, oop new_mirror) {
assert(_nmethod_mirror_index != -1, "cannot set JVMCI mirror for nmethod");
guarantee(_nmethod_mirror_index != -1, "cannot set JVMCI mirror for nmethod");
oop* addr = nm->oop_addr_at(_nmethod_mirror_index);
assert(new_mirror != nullptr, "use clear_nmethod_mirror to clear the mirror");
assert(*addr == nullptr, "cannot overwrite non-null mirror");
guarantee(new_mirror != nullptr, "use clear_nmethod_mirror to clear the mirror");
guarantee(*addr == nullptr, "cannot overwrite non-null mirror");

*addr = new_mirror;

Expand Down