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

public abstract Class CallArranger

extends Object
Class Inheritance
Known Direct Subclasses
jdk.internal.foreign.abi.aarch64.linux.LinuxAArch64CallArranger, jdk.internal.foreign.abi.aarch64.macos.MacOsAArch64CallArranger, jdk.internal.foreign.abi.aarch64.windows.WindowsAArch64CallArranger
Imports
jdk.internal.foreign.Utils, jdk.internal.foreign.abi.ABIDescriptor, .AbstractLinker.UpcallStubFactory, .Binding, .CallingSequence, .CallingSequenceBuilder, .DowncallLinker, .LinkerOptions, .SharedUtils, .VMStorage, jdk.internal.foreign.abi.aarch64.linux.LinuxAArch64CallArranger, jdk.internal.foreign.abi.aarch64.macos.MacOsAArch64CallArranger, jdk.internal.foreign.abi.aarch64.windows.WindowsAArch64CallArranger, java.lang.foreign.AddressLayout, .FunctionDescriptor, .GroupLayout, .MemoryLayout, .MemorySegment, .ValueLayout, java.lang.invoke.MethodHandle, .MethodType, java.util.List, .Optional

For the AArch64 C ABI specifically, this class uses CallingSequenceBuilder to translate a C FunctionDescriptor into a CallingSequence, which can then be turned into a MethodHandle. This includes taking care of synthetic arguments like pointers to return buffers for 'in-memory' returns. There are minor differences between the ABIs implemented on Linux, macOS, and Windows which are handled in sub-classes. Clients should access these through the provided public constants CallArranger.LINUX, CallArranger.MACOS, and CallArranger.WINDOWS.

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv abstract class
public static record
pack-priv class
pack-priv class
pack-priv class

Field Summary

Modifier and TypeField and Description
protected static final ABIDescriptor
C

private static final VMStorage
public static final CallArranger
public static final CallArranger
private static final int
public static final int
private static final int
public static final CallArranger

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
protected abstract ABIDescriptor
abiDescriptor()

Returns: The ABIDescriptor used by the CallArranger for the current platform.

public MethodHandle
public AbstractLinker.UpcallStubFactory
protected TypeClass
getArgumentClassForBindings(MemoryLayout layout, boolean forVariadicFunction)

public CallArranger.Bindings
getBindings(MethodType mt, FunctionDescriptor cDesc, boolean forUpcall)

public CallArranger.Bindings
getBindings(MethodType mt, FunctionDescriptor cDesc, boolean forUpcall, LinkerOptions options)

private static boolean
protected abstract boolean

Returns:

true if this ABI requires sub-slot (smaller than STACK_SLOT_SIZE) packing of arguments on the stack.
requiresSubSlotStackPacking
()

Returns true if this ABI requires sub-slot (smaller than STACK_SLOT_SIZE) packing of arguments on the stack.

protected abstract boolean

Returns:

true if this ABI passes some fields of a struct in registers.
spillsVariadicStructsPartially
()

Should some fields of structs that assigned to registers be passed in registers when there are not enough registers for all the fields of the struct?

protected abstract boolean

Returns:

true if this ABI uses general purpose registers for variadic floating point arguments.
useIntRegsForVariadicFloatingPointArgs
()

Are floating point arguments to variadic functions passed in general purpose registers instead of floating point registers?

protected abstract boolean

Returns:

true if variadic arguments should be spilled to the stack.
varArgsOnStack
()

Are variadic arguments assigned to registers as in the standard calling convention, or always passed on the stack?

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

Cback to summary
protected static final ABIDescriptor C
INDIRECT_RESULTback to summary
private static final VMStorage INDIRECT_RESULT
LINUXback to summary
public static final CallArranger LINUX
MACOSback to summary
public static final CallArranger MACOS
MAX_COPY_SIZEback to summary
private static final int MAX_COPY_SIZE
MAX_REGISTER_ARGUMENTSback to summary
public static final int MAX_REGISTER_ARGUMENTS
STACK_SLOT_SIZEback to summary
private static final int STACK_SLOT_SIZE
WINDOWSback to summary
public static final CallArranger WINDOWS

Constructor Detail

CallArrangerback to summary
protected CallArranger()

Method Detail

abiDescriptorback to summary
protected abstract ABIDescriptor abiDescriptor()
Returns:ABIDescriptor

The ABIDescriptor used by the CallArranger for the current platform.

arrangeDowncallback to summary
public MethodHandle arrangeDowncall(MethodType mt, FunctionDescriptor cDesc, LinkerOptions options)
arrangeUpcallback to summary
public AbstractLinker.UpcallStubFactory arrangeUpcall(MethodType mt, FunctionDescriptor cDesc, LinkerOptions options)
getArgumentClassForBindingsback to summary
protected TypeClass getArgumentClassForBindings(MemoryLayout layout, boolean forVariadicFunction)
getBindingsback to summary
public CallArranger.Bindings getBindings(MethodType mt, FunctionDescriptor cDesc, boolean forUpcall)
getBindingsback to summary
public CallArranger.Bindings getBindings(MethodType mt, FunctionDescriptor cDesc, boolean forUpcall, LinkerOptions options)
isInMemoryReturnback to summary
private static boolean isInMemoryReturn(Optional<MemoryLayout> returnLayout)
requiresSubSlotStackPackingback to summary
protected abstract boolean requiresSubSlotStackPacking()

Returns true if this ABI requires sub-slot (smaller than STACK_SLOT_SIZE) packing of arguments on the stack.

Returns:boolean

true if this ABI requires sub-slot (smaller than STACK_SLOT_SIZE) packing of arguments on the stack.

spillsVariadicStructsPartiallyback to summary
protected abstract boolean spillsVariadicStructsPartially()

Should some fields of structs that assigned to registers be passed in registers when there are not enough registers for all the fields of the struct? Returns true if this ABI passes some fields of a struct in registers.

Returns:boolean

true if this ABI passes some fields of a struct in registers.

useIntRegsForVariadicFloatingPointArgsback to summary
protected abstract boolean useIntRegsForVariadicFloatingPointArgs()

Are floating point arguments to variadic functions passed in general purpose registers instead of floating point registers? Returns true if this ABI uses general purpose registers for variadic floating point arguments.

Returns:boolean

true if this ABI uses general purpose registers for variadic floating point arguments.

varArgsOnStackback to summary
protected abstract boolean varArgsOnStack()

Are variadic arguments assigned to registers as in the standard calling convention, or always passed on the stack?

Returns:boolean

true if variadic arguments should be spilled to the stack.

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

pack-priv abstract Class CallArranger.BindingCalculator

extends Object
Class Inheritance
  • java.lang.Object
  • jdk.internal.foreign.abi.aarch64.CallArranger.BindingCalculator
Known Direct Subclasses
jdk.internal.foreign.abi.aarch64.CallArranger.UnboxBindingCalculator, jdk.internal.foreign.abi.aarch64.CallArranger.BoxBindingCalculator

Field Summary

Modifier and TypeField and Description
protected final CallArranger.StorageCalculator

Constructor Summary

AccessConstructor and Description
protected
BindingCalculator(boolean forArguments, boolean forVariadicFunction)

Method Summary

Modifier and TypeMethod and Description
pack-priv abstract List<Binding>
getBindings(Class<?> carrier, MemoryLayout layout)

pack-priv abstract List<Binding>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

storageCalculatorback to summary
protected final CallArranger.StorageCalculator storageCalculator

Constructor Detail

BindingCalculatorback to summary
protected BindingCalculator(boolean forArguments, boolean forVariadicFunction)

Method Detail

getBindingsback to summary
pack-priv abstract List<Binding> getBindings(Class<?> carrier, MemoryLayout layout)
getIndirectBindingsback to summary
pack-priv abstract List<Binding> getIndirectBindings()
jdk.internal.foreign.abi.aarch64 back to summary

public final Record CallArranger.Bindings

extends Record
Class Inheritance
Record Components
callingSequence:CallingSequence 
isInMemoryReturn:boolean 

Field Summary

Modifier and TypeField and Description
private final CallingSequence
callingSequence

Record Component accessed by callingSequence().

private final boolean
isInMemoryReturn

Record Component accessed by isInMemoryReturn().

Constructor Summary

AccessConstructor and Description
public
Bindings(CallingSequence callingSequence, boolean isInMemoryReturn)

Method Summary

Modifier and TypeMethod and Description
public CallingSequence
callingSequence()

Record Component getter of callingSequence.

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 boolean
isInMemoryReturn()

Record Component getter of isInMemoryReturn.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

callingSequenceback to summary
private final CallingSequence callingSequence

Record Component accessed by callingSequence().

isInMemoryReturnback to summary
private final boolean isInMemoryReturn

Record Component accessed by isInMemoryReturn().

Constructor Detail

Bindingsback to summary
public Bindings(CallingSequence callingSequence, boolean isInMemoryReturn)

Method Detail

callingSequenceback to summary
public CallingSequence callingSequence()

Record Component getter of callingSequence.

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.

isInMemoryReturnback to summary
public boolean isInMemoryReturn()

Record Component getter of isInMemoryReturn.

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.aarch64 back to summary

pack-priv Class CallArranger.BoxBindingCalculator

extends BindingCalculator
Class Inheritance

Field Summary

Inherited from jdk.internal.foreign.abi.aarch64.CallArranger.BindingCalculator:
storageCalculator

Constructor Summary

AccessConstructor and Description
pack-priv
BoxBindingCalculator(boolean forArguments)

Method Summary

Modifier and TypeMethod and Description
pack-priv List<Binding>
pack-priv List<Binding>

Constructor Detail

BoxBindingCalculatorback to summary
pack-priv BoxBindingCalculator(boolean forArguments)

Method Detail

getBindingsback to summary
pack-priv List<Binding> getBindings(Class<?> carrier, MemoryLayout layout)

Implements abstract jdk.internal.foreign.abi.aarch64.CallArranger.BindingCalculator.getBindings.

Annotations
@Override
getIndirectBindingsback to summary
pack-priv List<Binding> getIndirectBindings()

Implements abstract jdk.internal.foreign.abi.aarch64.CallArranger.BindingCalculator.getIndirectBindings.

Annotations
@Override
jdk.internal.foreign.abi.aarch64 back to summary

pack-priv Class CallArranger.StorageCalculator

extends Object
Class Inheritance
  • java.lang.Object
  • jdk.internal.foreign.abi.aarch64.CallArranger.StorageCalculator

Nested and Inner Type Summary

Modifier and TypeClass and Description
pack-priv static record

Field Summary

Modifier and TypeField and Description
private final boolean
private boolean
private final boolean
private final int[]
private long

Constructor Summary

AccessConstructor and Description
public
StorageCalculator(boolean forArguments, boolean forVariadicFunction)

Method Summary

Modifier and TypeMethod and Description
private static Class<?>
pack-priv void
private void
alignStack(long alignment)

private boolean
hasEnoughRegisters(int type, int count)

private boolean
hasRegister(int type)

pack-priv VMStorage
nextStorage(int type, ValueLayout layout)

private VMStorage
regAlloc(int type)

private VMStorage
pack-priv CallArranger.StorageCalculator.StructStorage[]
structStorages(GroupLayout layout, boolean forHFA)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

forArgumentsback to summary
private final boolean forArguments
forVarArgsback to summary
private boolean forVarArgs
forVariadicFunctionback to summary
private final boolean forVariadicFunction
nRegsback to summary
private final int[] nRegs
stackOffsetback to summary
private long stackOffset

Constructor Detail

StorageCalculatorback to summary
public StorageCalculator(boolean forArguments, boolean forVariadicFunction)

Method Detail

adjustCarrierForStackback to summary
private static Class<?> adjustCarrierForStack(Class<?> carrier)
adjustForVarArgsback to summary
pack-priv void adjustForVarArgs()
alignStackback to summary
private void alignStack(long alignment)
hasEnoughRegistersback to summary
private boolean hasEnoughRegisters(int type, int count)
hasRegisterback to summary
private boolean hasRegister(int type)
nextStorageback to summary
pack-priv VMStorage nextStorage(int type, ValueLayout layout)
regAllocback to summary
private VMStorage regAlloc(int type)
stackAllocback to summary
private VMStorage stackAlloc(ValueLayout layout)
structStoragesback to summary
pack-priv CallArranger.StorageCalculator.StructStorage[] structStorages(GroupLayout layout, boolean forHFA)
jdk.internal.foreign.abi.aarch64 back to summary

pack-priv final Record CallArranger.StorageCalculator.StructStorage

extends Record
Class Inheritance
Record Components
offset:long 
carrier:Class<?> 
byteWidth:int 
storage:VMStorage 

Field Summary

Modifier and TypeField and Description
private final int
byteWidth

Record Component accessed by byteWidth().

private final Class<?>
carrier

Record Component accessed by carrier().

private final long
offset

Record Component accessed by offset().

private final VMStorage
storage

Record Component accessed by storage().

Constructor Summary

AccessConstructor and Description
pack-priv
StructStorage(long offset, Class<?> carrier, int byteWidth, VMStorage storage)

Method Summary

Modifier and TypeMethod and Description
public int
byteWidth()

Record Component getter of byteWidth.

public Class<?>
carrier()

Record Component getter of carrier.

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 long
offset()

Record Component getter of offset.

public VMStorage
storage()

Record Component getter of storage.

public final String
toString()

Implements abstract java.lang.Record.toString.

Returns a string representation of the record.

Field Detail

byteWidthback to summary
private final int byteWidth

Record Component accessed by byteWidth().

carrierback to summary
private final Class<?> carrier

Record Component accessed by carrier().

offsetback to summary
private final long offset

Record Component accessed by offset().

storageback to summary
private final VMStorage storage

Record Component accessed by storage().

Constructor Detail

StructStorageback to summary
pack-priv StructStorage(long offset, Class<?> carrier, int byteWidth, VMStorage storage)

Method Detail

byteWidthback to summary
public int byteWidth()

Record Component getter of byteWidth.

carrierback to summary
public Class<?> carrier()

Record Component getter of carrier.

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.

offsetback to summary
public long offset()

Record Component getter of offset.

storageback to summary
public VMStorage storage()

Record Component getter of storage.

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.aarch64 back to summary

pack-priv Class CallArranger.UnboxBindingCalculator

extends BindingCalculator
Class Inheritance

Field Summary

Modifier and TypeField and Description
protected final boolean
protected final boolean
private final boolean
Inherited from jdk.internal.foreign.abi.aarch64.CallArranger.BindingCalculator:
storageCalculator

Constructor Summary

AccessConstructor and Description
pack-priv
UnboxBindingCalculator(boolean forArguments, boolean forVariadicFunction, boolean useAddressPairs)

Method Summary

Modifier and TypeMethod and Description
pack-priv List<Binding>
pack-priv List<Binding>

Field Detail

forArgumentsback to summary
protected final boolean forArguments
forVariadicFunctionback to summary
protected final boolean forVariadicFunction
useAddressPairsback to summary
private final boolean useAddressPairs

Constructor Detail

UnboxBindingCalculatorback to summary
pack-priv UnboxBindingCalculator(boolean forArguments, boolean forVariadicFunction, boolean useAddressPairs)

Method Detail

getBindingsback to summary
pack-priv List<Binding> getBindings(Class<?> carrier, MemoryLayout layout)

Implements abstract jdk.internal.foreign.abi.aarch64.CallArranger.BindingCalculator.getBindings.

Annotations
@Override
getIndirectBindingsback to summary
pack-priv List<Binding> getIndirectBindings()

Implements abstract jdk.internal.foreign.abi.aarch64.CallArranger.BindingCalculator.getIndirectBindings.

Annotations
@Override