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
8 changes: 1 addition & 7 deletions src/hotspot/share/gc/shared/barrierSetNMethod.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,16 +65,10 @@ bool BarrierSetNMethod::supports_entry_barrier(nmethod* nm) {
return false;
}

if (nm->is_native_method() || nm->is_compiled_by_c2() || nm->is_compiled_by_c1()) {
if (nm->is_native_method() || nm->is_compiled_by_c2() || nm->is_compiled_by_c1() || nm->is_compiled_by_jvmci()) {
return true;
}

#if INCLUDE_JVMCI
if (nm->is_compiled_by_jvmci() && nm->jvmci_nmethod_data()->has_entry_barrier()) {
return true;
}
#endif

return false;
}

Expand Down
19 changes: 7 additions & 12 deletions src/hotspot/share/jvmci/jvmciCodeInstaller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -771,11 +771,8 @@ JVMCI::CodeInstallResult CodeInstaller::install(JVMCICompiler* compiler,
JVMCI_THROW_MSG_(IllegalArgumentException, "InstalledCode object must be a HotSpotNmethod when installing a HotSpotCompiledNmethod", JVMCI::ok);
}

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

Expand Down Expand Up @@ -816,14 +813,12 @@ JVMCI::CodeInstallResult CodeInstaller::install(JVMCICompiler* compiler,
DirectivesStack::release(directive);
}

if (_nmethod_entry_patch_offset != -1) {
BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();
BarrierSetNMethod* bs_nm = BarrierSet::barrier_set()->barrier_set_nmethod();

// an empty error buffer for use by the verify_barrier code
err_msg msg("");
if (!bs_nm->verify_barrier(nm, msg)) {
JVMCI_THROW_MSG_(IllegalArgumentException, err_msg("nmethod entry barrier is malformed: %s", msg.buffer()), JVMCI::ok);
}
// an empty error buffer for use by the verify_barrier code
err_msg msg("");
if (!bs_nm->verify_barrier(nm, msg)) {
JVMCI_THROW_MSG_(IllegalArgumentException, err_msg("nmethod entry barrier is malformed: %s", msg.buffer()), JVMCI::ok);
}
}
}
Expand Down
1 change: 1 addition & 0 deletions src/hotspot/share/jvmci/jvmciRuntime.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -787,6 +787,7 @@ void JVMCINMethodData::initialize(int nmethod_mirror_index,
{
_failed_speculations = failed_speculations;
_nmethod_mirror_index = nmethod_mirror_index;
guarantee(nmethod_entry_patch_offset != -1, "missing entry barrier");
_nmethod_entry_patch_offset = nmethod_entry_patch_offset;
if (nmethod_mirror_name != nullptr) {
_has_name = true;
Expand Down
11 changes: 2 additions & 9 deletions src/hotspot/share/jvmci/jvmciRuntime.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,8 @@ class JVMCINMethodData : public ResourceObj {
// This is -1 if there is no mirror in the oops table.
int _nmethod_mirror_index;

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

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

bool has_entry_barrier() {
return _nmethod_entry_patch_offset != -1;
}

int nmethod_entry_patch_offset() {
guarantee(_nmethod_entry_patch_offset != -1, "missing entry barrier");
return _nmethod_entry_patch_offset;
}
};
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

Loading