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

public Class CallArranger

extends Object
Class Inheritance
Imports
jdk.internal.foreign.Utils, jdk.internal.foreign.abi.ABIDescriptor, .AbstractLinker.UpcallStubFactory, .Binding, .CallingSequence, .CallingSequenceBuilder, .DowncallLinker, .LinkerOptions, .SharedUtils, .VMStorage, jdk.internal.foreign.abi.x64.X86_64Architecture, java.lang.foreign.AddressLayout, .FunctionDescriptor, .GroupLayout, .MemoryLayout, .MemorySegment, .ValueLayout, java.lang.invoke.MethodHandle, .MethodHandles, .MethodType, java.util.List, .Optional

For the SysV x64 C ABI specifically, this class uses namely 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.

Nested and Inner Type Summary

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

Field Summary

Modifier and TypeField and Description
public static final ValueLayout.OfLong
C_LONG

The long native type.

private static final ABIDescriptor
private static final int
private static final int
private static final int

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public static MethodHandle
public static AbstractLinker.UpcallStubFactory
public static CallArranger.Bindings
getBindings(MethodType mt, FunctionDescriptor cDesc, boolean forUpcall)

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

private static boolean
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

C_LONGback to summary
public static final ValueLayout.OfLong C_LONG

The long native type.

CSysVback to summary
private static final ABIDescriptor CSysV
MAX_INTEGER_ARGUMENT_REGISTERSback to summary
private static final int MAX_INTEGER_ARGUMENT_REGISTERS
MAX_VECTOR_ARGUMENT_REGISTERSback to summary
private static final int MAX_VECTOR_ARGUMENT_REGISTERS
STACK_SLOT_SIZEback to summary
private static final int STACK_SLOT_SIZE

Constructor Detail

CallArrangerback to summary
public CallArranger()

Method Detail

arrangeDowncallback to summary
public static MethodHandle arrangeDowncall(MethodType mt, FunctionDescriptor cDesc, LinkerOptions options)
arrangeUpcallback to summary
public static AbstractLinker.UpcallStubFactory arrangeUpcall(MethodType mt, FunctionDescriptor cDesc, LinkerOptions options)
getBindingsback to summary
public static CallArranger.Bindings getBindings(MethodType mt, FunctionDescriptor cDesc, boolean forUpcall)
getBindingsback to summary
public static CallArranger.Bindings getBindings(MethodType mt, FunctionDescriptor cDesc, boolean forUpcall, LinkerOptions options)
isInMemoryReturnback to summary
private static boolean isInMemoryReturn(Optional<MemoryLayout> returnLayout)
jdk.internal.foreign.abi.x64.sysv back to summary

pack-priv abstract Class CallArranger.BindingCalculator

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

Field Summary

Modifier and TypeField and Description
protected final CallArranger.StorageCalculator

Constructor Summary

AccessConstructor and Description
protected
BindingCalculator(boolean forArguments)

Method Summary

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

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)

Method Detail

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

public final Record CallArranger.Bindings

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

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().

private final int
nVectorArgs

Record Component accessed by nVectorArgs().

Constructor Summary

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

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 int
nVectorArgs()

Record Component getter of nVectorArgs.

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().

nVectorArgsback to summary
private final int nVectorArgs

Record Component accessed by nVectorArgs().

Constructor Detail

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

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.

nVectorArgsback to summary
public int nVectorArgs()

Record Component getter of nVectorArgs.

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

pack-priv Class CallArranger.BoxBindingCalculator

extends BindingCalculator
Class Inheritance

Field Summary

Inherited from jdk.internal.foreign.abi.x64.sysv.CallArranger.BindingCalculator:
storageCalculator

Constructor Summary

AccessConstructor and Description
pack-priv
BoxBindingCalculator(boolean forArguments)

Method Summary

Modifier and TypeMethod and Description
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.x64.sysv.CallArranger.BindingCalculator.getBindings.

Annotations
@Override
jdk.internal.foreign.abi.x64.sysv back to summary

pack-priv Class CallArranger.StorageCalculator

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

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
StorageCalculator(boolean forArguments)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
private int
pack-priv VMStorage
nextStorage(int type)

pack-priv int
registerCount(int type)

pack-priv VMStorage
pack-priv VMStorage[]
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

forArgumentsback to summary
private final boolean forArguments
nIntegerRegback to summary
private int nIntegerReg
nVectorRegback to summary
private int nVectorReg
stackOffsetback to summary
private long stackOffset

Constructor Detail

StorageCalculatorback to summary
public StorageCalculator(boolean forArguments)

Method Detail

incrementRegisterCountback to summary
pack-priv void incrementRegisterCount(int type)
maxRegisterArgumentsback to summary
private int maxRegisterArguments(int type)
nextStorageback to summary
pack-priv VMStorage nextStorage(int type)
registerCountback to summary
pack-priv int registerCount(int type)
stackAllocback to summary
pack-priv VMStorage stackAlloc()
structStoragesback to summary
pack-priv VMStorage[] structStorages(TypeClass typeClass)
jdk.internal.foreign.abi.x64.sysv back to summary

pack-priv Class CallArranger.UnboxBindingCalculator

extends BindingCalculator
Class Inheritance

Field Summary

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

Constructor Summary

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

Method Summary

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

Field Detail

useAddressPairsback to summary
private final boolean useAddressPairs

Constructor Detail

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

Method Detail

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

Implements abstract jdk.internal.foreign.abi.x64.sysv.CallArranger.BindingCalculator.getBindings.

Annotations
@Override