8268279: gc/shenandoah/compiler/TestLinkToNativeRBP.java fails after LibraryLookup is gone

Reviewed-by: zgu, jiefu
This commit is contained in:
Xin Liu 2021-06-07 06:12:04 +00:00 committed by Jie Fu
parent b05fa02e74
commit 2aeeeb40a0

View File

@ -39,7 +39,7 @@
import jdk.incubator.foreign.CLinker;
import jdk.incubator.foreign.FunctionDescriptor;
import jdk.incubator.foreign.LibraryLookup;
import jdk.incubator.foreign.SymbolLookup;
import java.lang.invoke.MethodHandle;
import java.lang.invoke.MethodType;
@ -47,8 +47,12 @@ import java.lang.invoke.MethodType;
import static jdk.incubator.foreign.CLinker.C_INT;
public class TestLinkToNativeRBP {
static {
System.loadLibrary("LinkToNativeRBP");
}
final static CLinker abi = CLinker.getInstance();
static final LibraryLookup lookup = LibraryLookup.ofLibrary("LinkToNativeRBP");
static final SymbolLookup lookup = SymbolLookup.loaderLookup();
final static MethodHandle foo = abi.downcallHandle(lookup.lookup("foo").get(),
MethodType.methodType(int.class),
FunctionDescriptor.of(C_INT));