Skip to content

Commit b20fa7b

Browse files
author
Doug Simon
committed
8329982: compiler/jvmci/jdk.vm.ci.code.test/src/jdk/vm/ci/code/test/SimpleDebugInfoTest.java failed assert(oopDesc::is_oop_or_null(val)) failed: bad oop found
Reviewed-by: never
1 parent c1a1645 commit b20fa7b

File tree

14 files changed

+422
-327
lines changed

14 files changed

+422
-327
lines changed

src/hotspot/share/gc/shared/barrierSetNMethod.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,10 @@ bool BarrierSetNMethod::supports_entry_barrier(nmethod* nm) {
6565
return false;
6666
}
6767

68-
if (nm->is_native_method() || nm->is_compiled_by_c2() || nm->is_compiled_by_c1()) {
68+
if (nm->is_native_method() || nm->is_compiled_by_c2() || nm->is_compiled_by_c1() || nm->is_compiled_by_jvmci()) {
6969
return true;
7070
}
7171

72-
#if INCLUDE_JVMCI
73-
if (nm->is_compiled_by_jvmci() && nm->jvmci_nmethod_data()->has_entry_barrier()) {
74-
return true;
75-
}
76-
#endif
77-
7872
return false;
7973
}
8074

src/hotspot/share/jvmci/jvmciCodeInstaller.cpp

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -771,11 +771,8 @@ JVMCI::CodeInstallResult CodeInstaller::install(JVMCICompiler* compiler,
771771
JVMCI_THROW_MSG_(IllegalArgumentException, "InstalledCode object must be a HotSpotNmethod when installing a HotSpotCompiledNmethod", JVMCI::ok);
772772
}
773773

774-
// We would like to be strict about the nmethod entry barrier but there are various test
775-
// configurations which generate assembly without being a full compiler. So for now we enforce
776-
// that JIT compiled methods must have an nmethod barrier.
777-
bool install_default = JVMCIENV->get_HotSpotNmethod_isDefault(installed_code) != 0;
778-
if (_nmethod_entry_patch_offset == -1 && install_default) {
774+
// Enforce that compiled methods have an nmethod barrier.
775+
if (_nmethod_entry_patch_offset == -1) {
779776
JVMCI_THROW_MSG_(IllegalArgumentException, "nmethod entry barrier is missing", JVMCI::ok);
780777
}
781778

@@ -816,14 +813,12 @@ JVMCI::CodeInstallResult CodeInstaller::install(JVMCICompiler* compiler,
816813
DirectivesStack::release(directive);
817814
}
818815

819-
if (_nmethod_entry_patch_offset != -1) {
820-
BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
816+
BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
821817

822-
// an empty error buffer for use by the verify_barrier code
823-
err_msg msg("");
824-
if (!bs_nm->verify_barrier(nm, msg)) {
825-
JVMCI_THROW_MSG_(IllegalArgumentException, err_msg("nmethod entry barrier is malformed: %s", msg.buffer()), JVMCI::ok);
826-
}
818+
// an empty error buffer for use by the verify_barrier code
819+
err_msg msg("");
820+
if (!bs_nm->verify_barrier(nm, msg)) {
821+
JVMCI_THROW_MSG_(IllegalArgumentException, err_msg("nmethod entry barrier is malformed: %s", msg.buffer()), JVMCI::ok);
827822
}
828823
}
829824
}

src/hotspot/share/jvmci/jvmciRuntime.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,7 @@ void JVMCINMethodData::initialize(int nmethod_mirror_index,
787787
{
788788
_failed_speculations = failed_speculations;
789789
_nmethod_mirror_index = nmethod_mirror_index;
790+
guarantee(nmethod_entry_patch_offset != -1, "missing entry barrier");
790791
_nmethod_entry_patch_offset = nmethod_entry_patch_offset;
791792
if (nmethod_mirror_name != nullptr) {
792793
_has_name = true;

src/hotspot/share/jvmci/jvmciRuntime.hpp

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,8 @@ class JVMCINMethodData : public ResourceObj {
5454
// This is -1 if there is no mirror in the oops table.
5555
int _nmethod_mirror_index;
5656

57-
// This is the offset of the patchable part of the nmethod entry barrier sequence. The meaning is
58-
// somewhat platform dependent as the way patching is done varies by architecture. Older JVMCI
59-
// based compilers didn't emit the entry barrier so having a positive value for this offset
60-
// confirms that the installed code supports the entry barrier.
57+
// This is the offset of the patchable part of the nmethod entry barrier sequence. The meaning is
58+
// somewhat platform dependent as the way patching is done varies by architecture.
6159
int _nmethod_entry_patch_offset;
6260

6361
// Address of the failed speculations list to which a speculation
@@ -129,12 +127,7 @@ class JVMCINMethodData : public ResourceObj {
129127
// Sets the mirror in nm's oops table.
130128
void set_nmethod_mirror(nmethod* nm, oop mirror);
131129

132-
bool has_entry_barrier() {
133-
return _nmethod_entry_patch_offset != -1;
134-
}
135-
136130
int nmethod_entry_patch_offset() {
137-
guarantee(_nmethod_entry_patch_offset != -1, "missing entry barrier");
138131
return _nmethod_entry_patch_offset;
139132
}
140133
};

test/hotspot/jtreg/compiler/jvmci/compilerToVM/InvalidateInstalledCodeTest.java

Lines changed: 0 additions & 108 deletions
This file was deleted.

test/hotspot/jtreg/compiler/jvmci/events/JvmciNotifyInstallEventTest.config

Lines changed: 0 additions & 2 deletions
This file was deleted.

test/hotspot/jtreg/compiler/jvmci/events/JvmciNotifyInstallEventTest.java

Lines changed: 0 additions & 179 deletions
This file was deleted.

0 commit comments

Comments
 (0)