public class HotSpotNativeFunctionInterface extends Object implements NativeFunctionInterface
Modifier and Type | Field and Description |
---|---|
private Backend |
backend |
private HotSpotNativeFunctionHandle |
dllLookupFunctionHandle |
private RawNativeCallNodeFactory |
factory |
private HotSpotNativeFunctionPointer |
functionLookupFunctionPointer |
private HotSpotNativeFunctionPointer |
libraryLoadFunctionPointer |
private HotSpotNativeFunctionHandle |
libraryLookupFunctionHandle |
private HotSpotProviders |
providers |
private HotSpotNativeLibraryHandle |
rtldDefault |
Constructor and Description |
---|
HotSpotNativeFunctionInterface(HotSpotProviders providers,
RawNativeCallNodeFactory factory,
Backend backend,
long dlopen,
long dlsym,
long rtldDefault) |
Modifier and Type | Method and Description |
---|---|
private HotSpotNativeFunctionHandle |
createHandle(NativeFunctionPointer functionPointer,
Class<?> returnType,
Class<?>... argumentTypes) |
HotSpotNativeFunctionHandle |
getFunctionHandle(NativeFunctionPointer functionPointer,
Class<?> returnType,
Class<?>... argumentTypes)
Resolves a function pointer to a handle that can be called
with a given signature.
|
HotSpotNativeFunctionHandle |
getFunctionHandle(NativeLibraryHandle[] libraries,
String name,
Class<?> returnType,
Class<?>... argumentTypes)
Resolves a function name to a handle that can be called
with a given signature.
|
HotSpotNativeFunctionHandle |
getFunctionHandle(NativeLibraryHandle library,
String name,
Class<?> returnType,
Class<?>... argumentTypes)
Resolves a function name to a handle that can be called
with a given signature.
|
HotSpotNativeFunctionHandle |
getFunctionHandle(String name,
Class<?> returnType,
Class<?>... argumentTypes)
Resolves a function name to a handle that can be called
with a given signature.
|
HotSpotNativeFunctionPointer |
getFunctionPointer(NativeLibraryHandle[] libraries,
String name)
Resolves the function pointer
NativeFunctionPointer of a native function. |
HotSpotNativeLibraryHandle |
getLibraryHandle(String libPath)
Resolves and returns a handle to an open native library.
|
NativeFunctionPointer |
getNativeFunctionPointerFromRawValue(long rawValue)
Creates a
NativeFunctionPointer from a raw value. |
private InstalledCode |
installNativeFunctionStub(long functionPointer,
Class<?> returnType,
Class<?>... argumentTypes)
Creates and installs a stub for calling a native function.
|
boolean |
isDefaultLibrarySearchSupported()
Determines if the underlying platform/runtime supports the notion of a default library search
path.
|
private HotSpotNativeFunctionPointer |
lookupFunctionPointer(String name,
NativeLibraryHandle library,
boolean linkageErrorIfMissing) |
private final HotSpotProviders providers
private final HotSpotNativeLibraryHandle rtldDefault
private final HotSpotNativeFunctionPointer libraryLoadFunctionPointer
private final HotSpotNativeFunctionPointer functionLookupFunctionPointer
private final RawNativeCallNodeFactory factory
private HotSpotNativeFunctionHandle libraryLookupFunctionHandle
private HotSpotNativeFunctionHandle dllLookupFunctionHandle
public HotSpotNativeFunctionInterface(HotSpotProviders providers, RawNativeCallNodeFactory factory, Backend backend, long dlopen, long dlsym, long rtldDefault)
public HotSpotNativeLibraryHandle getLibraryHandle(String libPath)
NativeFunctionInterface
getLibraryHandle
in interface NativeFunctionInterface
libPath
- the absolute path to the librarypublic HotSpotNativeFunctionHandle getFunctionHandle(NativeLibraryHandle library, String name, Class<?> returnType, Class<?>... argumentTypes)
NativeFunctionInterface
getFunctionHandle
in interface NativeFunctionInterface
library
- the handle to a resolved libraryname
- the name of the function to be resolvedreturnType
- the type of the return valueargumentTypes
- the types of the argumentsnull
if the function
handle could not be resolvedpublic HotSpotNativeFunctionHandle getFunctionHandle(NativeLibraryHandle[] libraries, String name, Class<?> returnType, Class<?>... argumentTypes)
NativeFunctionInterface
getFunctionHandle
in interface NativeFunctionInterface
libraries
- the ordered list of libraries to search for the functionname
- the name of the function to be resolvedreturnType
- the type of the return valueargumentTypes
- the types of the argumentsnull
if the function
handle could not be resolvedpublic HotSpotNativeFunctionHandle getFunctionHandle(String name, Class<?> returnType, Class<?>... argumentTypes)
NativeFunctionInterface
getFunctionHandle
in interface NativeFunctionInterface
name
- the name of the function to be resolvedreturnType
- the type of the return valueargumentTypes
- the types of the argumentsnull
if default library
searching is not supported or if the
function could not be resolvedprivate HotSpotNativeFunctionPointer lookupFunctionPointer(String name, NativeLibraryHandle library, boolean linkageErrorIfMissing)
public HotSpotNativeFunctionHandle getFunctionHandle(NativeFunctionPointer functionPointer, Class<?> returnType, Class<?>... argumentTypes)
NativeFunctionInterface
getFunctionHandle
in interface NativeFunctionInterface
functionPointer
- a function pointerreturnType
- the type of the return valueargumentTypes
- the types of the argumentsnull
if the function
handle could not be resolvedprivate HotSpotNativeFunctionHandle createHandle(NativeFunctionPointer functionPointer, Class<?> returnType, Class<?>... argumentTypes)
private InstalledCode installNativeFunctionStub(long functionPointer, Class<?> returnType, Class<?>... argumentTypes)
public HotSpotNativeFunctionPointer getFunctionPointer(NativeLibraryHandle[] libraries, String name)
NativeFunctionInterface
NativeFunctionPointer
of a native function.getFunctionPointer
in interface NativeFunctionInterface
libraries
- the ordered list of libraries to search for the functionname
- the name of the function to be resolvednull
if the function pointer could
not be resolvedpublic boolean isDefaultLibrarySearchSupported()
NativeFunctionInterface
LD_LIBRARY_PATH
environment variable.isDefaultLibrarySearchSupported
in interface NativeFunctionInterface
public NativeFunctionPointer getNativeFunctionPointerFromRawValue(long rawValue)
NativeFunctionInterface
NativeFunctionPointer
from a raw value.getNativeFunctionPointerFromRawValue
in interface NativeFunctionInterface
rawValue
- raw function pointerNativeFunctionPointer
for rawValue