Skip to content

Commit 7452d50

Browse files
author
Doug Simon
committed
8318940: [JVMCI] do not set HotSpotNmethod oop for a default HotSpotNmethod
Reviewed-by: thartmann, never
1 parent 3e39d7b commit 7452d50

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/hotspot/share/jvmci/jvmciCompilerToVM.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -2779,11 +2779,11 @@ C2V_VMENTRY_0(jlong, translate, (JNIEnv* env, jobject, jobject obj_handle, jbool
27792779
} else {
27802780
// Link the new HotSpotNmethod to the nmethod
27812781
PEER_JVMCIENV->initialize_installed_code(result, nm, JVMCI_CHECK_0);
2782-
// Only HotSpotNmethod instances in the HotSpot heap are tracked directly by the runtime.
2783-
if (PEER_JVMCIENV->is_hotspot()) {
2782+
// Only non-default HotSpotNmethod instances in the HotSpot heap are tracked directly by the runtime.
2783+
if (!isDefault && PEER_JVMCIENV->is_hotspot()) {
27842784
JVMCINMethodData* data = nm->jvmci_nmethod_data();
27852785
if (data == nullptr) {
2786-
JVMCI_THROW_MSG_0(IllegalArgumentException, "Cannot set HotSpotNmethod mirror for default nmethod");
2786+
JVMCI_THROW_MSG_0(IllegalArgumentException, "Missing HotSpotNmethod data");
27872787
}
27882788
if (data->get_nmethod_mirror(nm, /* phantom_ref */ false) != nullptr) {
27892789
JVMCI_THROW_MSG_0(IllegalArgumentException, "Cannot overwrite existing HotSpotNmethod mirror for nmethod");

src/hotspot/share/jvmci/jvmciRuntime.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -824,10 +824,10 @@ oop JVMCINMethodData::get_nmethod_mirror(nmethod* nm, bool phantom_ref) {
824824
}
825825

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

832832
*addr = new_mirror;
833833

0 commit comments

Comments
 (0)