APIdia Launch Partner
Top Inners Fields Constructors Methods
jdk.internal.foreign.abi.fallback

public final Class FallbackLinker

extends AbstractLinker
Class Inheritance
Imports
jdk.internal.foreign.AbstractMemorySegmentImpl, .MemorySessionImpl, jdk.internal.foreign.abi.AbstractLinker, .CapturableState, .LinkerOptions, .SharedUtils, java.lang.foreign.AddressLayout, .Arena, .FunctionDescriptor, .GroupLayout, .MemoryLayout, .MemorySegment, .SegmentAllocator, .SequenceLayout, .ValueLayout, java.lang.invoke.MethodHandle, .MethodHandles, .MethodType, java.lang.ref.Reference, java.util.ArrayList, .List, .Map

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static record
private static record

Field Summary

Modifier and TypeField and Description
private static final MethodHandle
private static final MethodHandle

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
protected MethodHandle
protected AbstractLinker.UpcallStubFactory
private static void
private static void
public Map<String, MemoryLayout>
canonicalLayouts()

Implements java.lang.foreign.Linker.canonicalLayouts.

Returns an unmodifiable mapping between the names of data types used by the ABI implemented by this linker and their canonical layouts.

private static Object
doDowncall(SegmentAllocator returnAllocator, Object[] args, FallbackLinker.DowncallData invData)

private static void
private static IllegalArgumentException
public static FallbackLinker
public static boolean
private static MemorySegment
makeCif(MethodType methodType, FunctionDescriptor function, LinkerOptions options, Arena scope)

private static Object
private static void
Inherited from jdk.internal.foreign.abi.AbstractLinker:
checkStructMemberdefaultLookupdowncallHandledowncallHandleupcallStub

Field Detail

MH_DO_DOWNCALLback to summary
private static final MethodHandle MH_DO_DOWNCALL
MH_DO_UPCALLback to summary
private static final MethodHandle MH_DO_UPCALL

Constructor Detail

FallbackLinkerback to summary
public FallbackLinker()

Method Detail

arrangeDowncallback to summary
protected MethodHandle arrangeDowncall(MethodType inferredMethodType, FunctionDescriptor function, LinkerOptions options)

Implements abstract jdk.internal.foreign.abi.AbstractLinker.arrangeDowncall.

Annotations
@Override
arrangeUpcallback to summary
protected AbstractLinker.UpcallStubFactory arrangeUpcall(MethodType targetType, FunctionDescriptor function, LinkerOptions options)

Implements abstract jdk.internal.foreign.abi.AbstractLinker.arrangeUpcall.

Annotations
@Override
assertNotEmptyback to summary
private static void assertNotEmpty(FunctionDescriptor fd)
assertNotEmptyback to summary
private static void assertNotEmpty(MemoryLayout layout)
canonicalLayoutsback to summary
public Map<String, MemoryLayout> canonicalLayouts()

Implements java.lang.foreign.Linker.canonicalLayouts.

Doc from java.lang.foreign.Linker.canonicalLayouts.

Returns an unmodifiable mapping between the names of data types used by the ABI implemented by this linker and their canonical layouts.

Each Linker is responsible for choosing the data types that are widely recognized as useful on the OS and processor combination supported by the Linker. Accordingly, the precise set of data type names and canonical layouts exposed by the linker are unspecified; they vary from one Linker to another.

Annotations
@Override
doDowncallback to summary
private static Object doDowncall(SegmentAllocator returnAllocator, Object[] args, FallbackLinker.DowncallData invData)
doUpcallback to summary
private static void doUpcall(MethodHandle target, MemorySegment retPtr, MemorySegment argPtrs, FallbackLinker.UpcallData data) throws Throwable
Annotations
@SuppressWarnings:restricted
emptyback to summary
private static IllegalArgumentException empty(MemoryLayout layout)
getInstanceback to summary
public static FallbackLinker getInstance()
isSupportedback to summary
public static boolean isSupported()
makeCifback to summary
private static MemorySegment makeCif(MethodType methodType, FunctionDescriptor function, LinkerOptions options, Arena scope)
readValueback to summary
private static Object readValue(MemorySegment seg, MemoryLayout layout)
writeValueback to summary
private static void writeValue(Object arg, MemoryLayout layout, MemorySegment argSeg)
jdk.internal.foreign.abi.fallback back to summary

private final Record FallbackLinker.DowncallData

extends Record
Class Inheritance
Record Components
cif:MemorySegment 
returnLayout:MemoryLayout 
argLayouts:List<MemoryLayout> 
capturedStateMask:int 
allowsHeapAccess:boolean 

Field Summary

Modifier and TypeField and Description
private final boolean
allowsHeapAccess

Record Component accessed by allowsHeapAccess().

private final List<MemoryLayout>
argLayouts

Record Component accessed by argLayouts().

private final int
capturedStateMask

Record Component accessed by capturedStateMask().

private final MemorySegment
cif

Record Component accessed by cif().

private final MemoryLayout
returnLayout

Record Component accessed by returnLayout().

Constructor Summary

AccessConstructor and Description
private
DowncallData(MemorySegment cif, MemoryLayout returnLayout, List<MemoryLayout> argLayouts, int capturedStateMask, boolean allowsHeapAccess)

Method Summary

Modifier and TypeMethod and Description
public boolean
allowsHeapAccess()

Record Component getter of allowsHeapAccess.

public List<MemoryLayout>
argLayouts()

Record Component getter of argLayouts.

public int
capturedStateMask()

Record Component getter of capturedStateMask.

public MemorySegment
cif()

Record Component getter of cif.

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public MemoryLayout
returnLayout()

Record Component getter of returnLayout.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

allowsHeapAccessback to summary
private final boolean allowsHeapAccess

Record Component accessed by allowsHeapAccess().

argLayoutsback to summary
private final List<MemoryLayout> argLayouts

Record Component accessed by argLayouts().

capturedStateMaskback to summary
private final int capturedStateMask

Record Component accessed by capturedStateMask().

cifback to summary
private final MemorySegment cif

Record Component accessed by cif().

returnLayoutback to summary
private final MemoryLayout returnLayout

Record Component accessed by returnLayout().

Constructor Detail

DowncallDataback to summary
private DowncallData(MemorySegment cif, MemoryLayout returnLayout, List<MemoryLayout> argLayouts, int capturedStateMask, boolean allowsHeapAccess)

Method Detail

allowsHeapAccessback to summary
public boolean allowsHeapAccess()

Record Component getter of allowsHeapAccess.

argLayoutsback to summary
public List<MemoryLayout> argLayouts()

Record Component getter of argLayouts.

capturedStateMaskback to summary
public int capturedStateMask()

Record Component getter of capturedStateMask.

cifback to summary
public MemorySegment cif()

Record Component getter of cif.

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

returnLayoutback to summary
public MemoryLayout returnLayout()

Record Component getter of returnLayout.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

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.

jdk.internal.foreign.abi.fallback back to summary

private final Record FallbackLinker.UpcallData

extends Record
Class Inheritance
Record Components
returnLayout:MemoryLayout 
argLayouts:List<MemoryLayout> 
cif:MemorySegment 

Field Summary

Modifier and TypeField and Description
private final List<MemoryLayout>
argLayouts

Record Component accessed by argLayouts().

private final MemorySegment
cif

Record Component accessed by cif().

private final MemoryLayout
returnLayout

Record Component accessed by returnLayout().

Constructor Summary

AccessConstructor and Description
private
UpcallData(MemoryLayout returnLayout, List<MemoryLayout> argLayouts, MemorySegment cif)

Method Summary

Modifier and TypeMethod and Description
public List<MemoryLayout>
argLayouts()

Record Component getter of argLayouts.

public MemorySegment
cif()

Record Component getter of cif.

public final boolean
equals(Object o)

Implements abstract java.lang.Record.equals.

Indicates whether some other object is "equal to" this one.

public final int
hashCode()

Implements abstract java.lang.Record.hashCode.

Returns a hash code value for the record.

public MemoryLayout
returnLayout()

Record Component getter of returnLayout.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

argLayoutsback to summary
private final List<MemoryLayout> argLayouts

Record Component accessed by argLayouts().

cifback to summary
private final MemorySegment cif

Record Component accessed by cif().

returnLayoutback to summary
private final MemoryLayout returnLayout

Record Component accessed by returnLayout().

Constructor Detail

UpcallDataback to summary
private UpcallData(MemoryLayout returnLayout, List<MemoryLayout> argLayouts, MemorySegment cif)

Method Detail

argLayoutsback to summary
public List<MemoryLayout> argLayouts()

Record Component getter of argLayouts.

cifback to summary
public MemorySegment cif()

Record Component getter of cif.

equalsback to summary
public final boolean equals(Object o)

Implements abstract java.lang.Record.equals.

Doc from java.lang.Record.equals.

Indicates whether some other object is "equal to" this one. In addition to the general contract of Object.equals, record classes must further obey the invariant that when a record instance is "copied" by passing the result of the record component accessor methods to the canonical constructor, as follows:

    R copy = new R(r.c1(), r.c2(), ..., r.cn());
then it must be the case that r.equals(copy).
hashCodeback to summary
public final int hashCode()

Implements abstract java.lang.Record.hashCode.

Doc from java.lang.Record.hashCode.

Returns a hash code value for the record. Obeys the general contract of Object.hashCode. For records, hashing behavior is constrained by the refined contract of Record.equals, so that any two records created from the same components must have the same hash code.

returnLayoutback to summary
public MemoryLayout returnLayout()

Record Component getter of returnLayout.

toStringback to summary
public final String toString()

Implements abstract java.lang.Record.toString.

Doc from java.lang.Record.toString.

Returns a string representation of the record. In accordance with the general contract of Object#toString(), the toString method returns a string that "textually represents" this record. The result should be a concise but informative representation that is easy for a person to read.

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.