Skip to content
Closed
Show file tree
Hide file tree
Changes from 2 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
5 changes: 1 addition & 4 deletions src/hotspot/share/jvmci/jvmciCodeInstaller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -771,10 +771,7 @@ 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;
// 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
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.

Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
import jdk.vm.ci.hotspot.HotSpotCodeCacheProvider;
import jdk.vm.ci.hotspot.HotSpotCompiledCode;
import jdk.vm.ci.hotspot.HotSpotJVMCIRuntime;
import jdk.vm.ci.hotspot.HotSpotNmethod;
import jdk.vm.ci.hotspot.HotSpotResolvedJavaMethod;
import jdk.vm.ci.meta.ConstantReflectionProvider;
import jdk.vm.ci.meta.MetaAccessProvider;
Expand Down Expand Up @@ -95,7 +96,7 @@ protected Method getMethod(String name, Class<?>... args) {
}
}

protected void test(TestCompiler compiler, Method method, Object... args) {
protected HotSpotNmethod test(TestCompiler compiler, Method method, Object... args) {
try {
HotSpotResolvedJavaMethod resolvedMethod = (HotSpotResolvedJavaMethod) metaAccess.lookupJavaMethod(method);
TestAssembler asm = createAssembler();
Expand All @@ -115,9 +116,9 @@ protected void test(TestCompiler compiler, Method method, Object... args) {
Object expected = method.invoke(null, args);
Object actual = installed.executeVarargs(args);
Assert.assertEquals(expected, actual);
return (HotSpotNmethod) installed;
} catch (Exception e) {
e.printStackTrace();
Assert.fail(e.toString());
throw new AssertionError(e);
}
}
}
Loading