| Modifier and Type | Class and Description |
|---|---|
| private static record | |
| public static interface |
| Modifier and Type | Field and Description |
|---|---|
| private final Set | |
| private final SoftReferenceCache | |
| private final SoftReferenceCache |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| protected abstract MethodHandle | |
| protected abstract AbstractLinker. | |
| private static void | |
| private void | |
| private void | |
| private void | |
| private void | |
| private static void | checkMemberOffset(StructLayout parent, MemoryLayout memberLayout, long lastUnpaddedOffset, long offset)
|
| private static void | |
| protected void | |
| private void | |
| public SystemLookup | defaultLookup()
Implements java. Returns a symbol lookup for symbols in a set of commonly used libraries. |
| public final MethodHandle | downcallHandle(MemorySegment symbol, FunctionDescriptor function, Linker.
Implements java. Creates a method handle that is used to call a foreign function with the given signature and address. |
| public final MethodHandle | downcallHandle(FunctionDescriptor function, Linker.
Implements java. Creates a method handle that is used to call a foreign function with the given signature. |
| private MethodHandle | |
| private static String | |
| private static IllegalArgumentException | |
| private static MemoryLayout | |
| private static MemoryLayout[] | |
| private static FunctionDescriptor | |
| public final MemorySegment | upcallStub(MethodHandle target, FunctionDescriptor function, Arena arena, Linker.
Implements java. Creates an upcall stub which can be passed to other foreign functions as a function pointer, associated with the given arena. |
| private void |
| CANONICAL_LAYOUTS_CACHE | back to summary |
|---|---|
| private final Set<MemoryLayout> CANONICAL_LAYOUTS_CACHE | |
| DOWNCALL_CACHE | back to summary |
|---|---|
| private final SoftReferenceCache<AbstractLinker. | |
| UPCALL_CACHE | back to summary |
|---|---|
| private final SoftReferenceCache<AbstractLinker. | |
| AbstractLinker | back to summary |
|---|---|
| public AbstractLinker() | |
| arrangeDowncall | back to summary |
|---|---|
| protected abstract MethodHandle arrangeDowncall(MethodType inferredMethodType, FunctionDescriptor function, LinkerOptions options) | |
| arrangeUpcall | back to summary |
|---|---|
| protected abstract AbstractLinker. | |
| checkGroup | back to summary |
|---|---|
| private static void checkGroup(GroupLayout gl, long maxUnpaddedOffset) | |
| checkHasNaturalAlignment | back to summary |
|---|---|
| private void checkHasNaturalAlignment(MemoryLayout layout) | |
| checkLayout | back to summary |
|---|---|
| private void checkLayout(MemoryLayout layout) | |
| checkLayoutRecursive | back to summary |
|---|---|
| private void checkLayoutRecursive(MemoryLayout layout) | |
| checkLayouts | back to summary |
|---|---|
| private void checkLayouts(FunctionDescriptor descriptor) | |
| checkMemberOffset | back to summary |
|---|---|
| private static void checkMemberOffset(StructLayout parent, MemoryLayout memberLayout, long lastUnpaddedOffset, long offset) | |
| checkNotAllPadding | back to summary |
|---|---|
| private static void checkNotAllPadding(StructLayout sl) | |
| checkStructMember | back to summary |
|---|---|
| protected void checkStructMember(MemoryLayout member, long offset) | |
| checkSupported | back to summary |
|---|---|
| private void checkSupported(ValueLayout valueLayout) | |
| defaultLookup | back to summary |
|---|---|
| public SystemLookup defaultLookup() Implements java. Doc from java. Returns a symbol lookup for symbols in a set of commonly used libraries.
Each
| |
| downcallHandle | back to summary |
|---|---|
| public final MethodHandle downcallHandle(MemorySegment symbol, FunctionDescriptor function, Linker. Implements java. Doc from java. Creates a method handle that is used to call a foreign function with the given signature and address. Calling this method is equivalent to the following code: linker.downcallHandle(function, options).bindTo(address);
| |
| downcallHandle | back to summary |
|---|---|
| public final MethodHandle downcallHandle(FunctionDescriptor function, Linker. Implements java. Doc from java. Creates a method handle that is used to call a foreign function with the given signature.
The Java method type associated with the
returned method handle is derived
from the argument and return layouts in the function descriptor, but features an
additional leading parameter of type
Upon invoking a downcall method handle, the linker provides the following
guarantees for any argument
Moreover, if the provided function descriptor's return layout is an
address layout, invoking the returned method handle
will return a native segment associated with the global scope. Under normal
conditions, the size of the returned segment is
The returned method handle will throw an
| |
| downcallHandle0 | back to summary |
|---|---|
| private MethodHandle downcallHandle0(FunctionDescriptor function, Linker. | |
| inMessage | back to summary |
|---|---|
| private static String inMessage(GroupLayout gl) | |
| memberException | back to summary |
|---|---|
| private static IllegalArgumentException memberException(MemoryLayout parent, MemoryLayout member, String info) | |
| stripNames | back to summary |
|---|---|
private static MemoryLayout stripNames(MemoryLayout ml)
| |
| stripNames | back to summary |
|---|---|
| private static MemoryLayout[] stripNames(List<MemoryLayout> layouts) | |
| stripNames | back to summary |
|---|---|
| private static FunctionDescriptor stripNames(FunctionDescriptor function) | |
| upcallStub | back to summary |
|---|---|
| public final MemorySegment upcallStub(MethodHandle target, FunctionDescriptor function, Arena arena, Linker. Implements java. Doc from java. Creates an upcall stub which can be passed to other foreign functions as a function pointer, associated with the given arena. Calling such a function pointer from foreign code will result in the execution of the provided method handle. The returned memory segment's address points to the newly allocated upcall stub, and is associated with the provided arena. As such, the lifetime of the returned upcall stub segment is controlled by the provided arena. For instance, if the provided arena is a confined arena, the returned upcall stub segment will be deallocated when the provided confined arena is closed.
An upcall stub argument whose corresponding layout is an
address layout is a native segment associated with the
global scope. Under normal conditions, the size of this segment argument is
The target method handle should not throw any exceptions. If the target method
handle does throw an exception, the JVM will terminate abruptly. To avoid this,
clients should wrap the code in the target method handle in a try/catch block to
catch any unexpected exceptions. This can be done using the
| |
| validateVariadicLayouts | back to summary |
|---|---|
| private void validateVariadicLayouts(FunctionDescriptor function, LinkerOptions optionSet) | |
| Modifier and Type | Field and Description |
|---|---|
| private final FunctionDescriptor | descriptor
Record Component accessed by descriptor(). |
| private final LinkerOptions |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public FunctionDescriptor | |
| public boolean | equals(Object obj)
Implements abstract java. Indicates whether some other object is "equal to" this one. |
| public int | |
| public LinkerOptions | |
| public final String | toString()
Implements abstract java. Returns a string representation of the record. |
| descriptor | back to summary |
|---|---|
| private final FunctionDescriptor descriptor Record Component accessed by descriptor(). | |
| options | back to summary |
|---|---|
| private final LinkerOptions options Record Component accessed by options(). | |
| LinkRequest | back to summary |
|---|---|
| private LinkRequest(FunctionDescriptor descriptor, LinkerOptions options) | |
| descriptor | back to summary |
|---|---|
| public FunctionDescriptor descriptor() Record Component getter of descriptor. | |
| equals | back to summary |
|---|---|
| public boolean equals(Object obj) Implements abstract java. Doc from java. Indicates whether some other object is "equal to" this one. In addition
to the general contract of
R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
| |
| hashCode | back to summary |
|---|---|
| public int hashCode() Implements abstract java. Doc from java. Returns a hash code value for the record.
Obeys the general contract of
| |
| options | back to summary |
|---|---|
| public LinkerOptions options() Record Component getter of options. | |
| toString | back to summary |
|---|---|
| public final String toString() Implements abstract java. Doc from java. Returns a string representation of the record.
In accordance with the general contract of In addition to this general contract, record classes must further participate in the invariant that any two records which are equal must produce equal strings. This invariant is necessarily relaxed in the rare case where corresponding equal component values might fail to produce equal strings for themselves. | |
| Modifier and Type | Method and Description |
|---|---|
| public MemorySegment |
| makeStub | back to summary |
|---|---|
| public MemorySegment makeStub(MethodHandle target, Arena arena) | |