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)
NativeFunctionInterfacegetLibraryHandle in interface NativeFunctionInterfacelibPath - the absolute path to the librarypublic HotSpotNativeFunctionHandle getFunctionHandle(NativeLibraryHandle library, String name, Class<?> returnType, Class<?>... argumentTypes)
NativeFunctionInterfacegetFunctionHandle in interface NativeFunctionInterfacelibrary - 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)
NativeFunctionInterfacegetFunctionHandle in interface NativeFunctionInterfacelibraries - 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)
NativeFunctionInterfacegetFunctionHandle in interface NativeFunctionInterfacename - 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)
NativeFunctionInterfacegetFunctionHandle in interface NativeFunctionInterfacefunctionPointer - 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)
NativeFunctionInterfaceNativeFunctionPointer of a native function.getFunctionPointer in interface NativeFunctionInterfacelibraries - 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()
NativeFunctionInterfaceLD_LIBRARY_PATH
environment variable.isDefaultLibrarySearchSupported in interface NativeFunctionInterfacepublic NativeFunctionPointer getNativeFunctionPointerFromRawValue(long rawValue)
NativeFunctionInterfaceNativeFunctionPointer from a raw value.getNativeFunctionPointerFromRawValue in interface NativeFunctionInterfacerawValue - raw function pointerNativeFunctionPointer for rawValue