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

public Class LinuxRISCV64CallArranger

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

For the RISCV64 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.

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
private static final ABIDescriptor
public 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 LinuxRISCV64CallArranger.Bindings
getBindings(MethodType mt, FunctionDescriptor cDesc, boolean forUpcall)

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

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

Field Detail

CLinuxback to summary
private static final ABIDescriptor CLinux
MAX_REGISTER_ARGUMENTSback to summary
public static final int MAX_REGISTER_ARGUMENTS
STACK_SLOT_SIZEback to summary
private static final int STACK_SLOT_SIZE

Constructor Detail

LinuxRISCV64CallArrangerback to summary
public LinuxRISCV64CallArranger()

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 LinuxRISCV64CallArranger.Bindings getBindings(MethodType mt, FunctionDescriptor cDesc, boolean forUpcall)
getBindingsback to summary
public static LinuxRISCV64CallArranger.Bindings getBindings(MethodType mt, FunctionDescriptor cDesc, boolean forUpcall, LinkerOptions options)
isInMemoryReturnback to summary
private static boolean isInMemoryReturn(Optional<MemoryLayout> returnLayout)
jdk.internal.foreign.abi.riscv64.linux back to summary

pack-priv abstract Class LinuxRISCV64CallArranger.BindingCalculator

extends Object
Class Inheritance
  • java.lang.Object
  • jdk.internal.foreign.abi.riscv64.linux.LinuxRISCV64CallArranger.BindingCalculator
Known Direct Subclasses
jdk.internal.foreign.abi.riscv64.linux.LinuxRISCV64CallArranger.UnboxBindingCalculator, jdk.internal.foreign.abi.riscv64.linux.LinuxRISCV64CallArranger.BoxBindingCalculator

Field Summary

Modifier and TypeField and Description
pack-priv static final Map<TypeClass, TypeClass>
protected final LinuxRISCV64CallArranger.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, boolean isVariadicArg)

public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

conventionConverterMapback to summary
pack-priv static final Map<TypeClass, TypeClass> conventionConverterMap
storageCalculatorback to summary
protected final LinuxRISCV64CallArranger.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, boolean isVariadicArg)
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
jdk.internal.foreign.abi.riscv64.linux back to summary

public final Record LinuxRISCV64CallArranger.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.riscv64.linux back to summary

pack-priv Class LinuxRISCV64CallArranger.BoxBindingCalculator

extends BindingCalculator
Class Inheritance

Field Summary

Inherited from jdk.internal.foreign.abi.riscv64.linux.LinuxRISCV64CallArranger.BindingCalculator:
conventionConverterMapstorageCalculator

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>
getBindings(Class<?> carrier, MemoryLayout layout, TypeClass argumentClass, boolean isVariadicArg)

Inherited from jdk.internal.foreign.abi.riscv64.linux.LinuxRISCV64CallArranger.BindingCalculator:
toString

Constructor Detail

BoxBindingCalculatorback to summary
pack-priv BoxBindingCalculator(boolean forArguments)

Method Detail

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

Implements abstract jdk.internal.foreign.abi.riscv64.linux.LinuxRISCV64CallArranger.BindingCalculator.getBindings.

Annotations
@Override
getBindingsback to summary
pack-priv List<Binding> getBindings(Class<?> carrier, MemoryLayout layout, TypeClass argumentClass, boolean isVariadicArg)
jdk.internal.foreign.abi.riscv64.linux back to summary

pack-priv Class LinuxRISCV64CallArranger.StorageCalculator

extends Object
Class Inheritance
  • java.lang.Object
  • jdk.internal.foreign.abi.riscv64.linux.LinuxRISCV64CallArranger.StorageCalculator

Field Summary

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

Constructor Summary

AccessConstructor and Description
public
StorageCalculator(boolean forArguments)

Method Summary

Modifier and TypeMethod and Description
pack-priv void
alignStack(long alignment)

pack-priv void
pack-priv VMStorage
getStorage(int storageClass)

pack-priv VMStorage[]
getStorages(MemoryLayout layout, boolean isVariadicArg)

pack-priv Optional<VMStorage>
regAlloc(int storageClass)

pack-priv boolean
regsAvailable(int integerRegs, int floatRegs)

pack-priv VMStorage
public String
toString()

Overrides java.lang.Object.toString.

Returns a string representation of the object.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAllwaitwaitwait

Field Detail

FloatRegIdxback to summary
private final int FloatRegIdx
forArgumentsback to summary
private final boolean forArguments
IntegerRegIdxback to summary
private final int IntegerRegIdx
nRegsback to summary
private final int[] nRegs
stackOffsetback to summary
private long stackOffset

Constructor Detail

StorageCalculatorback to summary
public StorageCalculator(boolean forArguments)

Method Detail

alignStackback to summary
pack-priv void alignStack(long alignment)
alignStorageback to summary
pack-priv void alignStorage()
getStorageback to summary
pack-priv VMStorage getStorage(int storageClass)
getStoragesback to summary
pack-priv VMStorage[] getStorages(MemoryLayout layout, boolean isVariadicArg)
regAllocback to summary
pack-priv Optional<VMStorage> regAlloc(int storageClass)
regsAvailableback to summary
pack-priv boolean regsAvailable(int integerRegs, int floatRegs)
stackAllocback to summary
pack-priv VMStorage stackAlloc()
toStringback to summary
public String toString()

Overrides java.lang.Object.toString.

Doc from java.lang.Object.toString.

Returns a string representation of the object. Satisfying this method's contract implies a non-null result must be returned.

Annotations
@Override
jdk.internal.foreign.abi.riscv64.linux back to summary

pack-priv final Class LinuxRISCV64CallArranger.UnboxBindingCalculator

extends BindingCalculator
Class Inheritance

Field Summary

Modifier and TypeField and Description
protected final boolean
private final boolean
Inherited from jdk.internal.foreign.abi.riscv64.linux.LinuxRISCV64CallArranger.BindingCalculator:
conventionConverterMapstorageCalculator

Constructor Summary

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

Method Summary

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

Inherited from jdk.internal.foreign.abi.riscv64.linux.LinuxRISCV64CallArranger.BindingCalculator:
toString

Field Detail

forArgumentsback to summary
protected final boolean forArguments
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, boolean isVariadicArg)

Implements abstract jdk.internal.foreign.abi.riscv64.linux.LinuxRISCV64CallArranger.BindingCalculator.getBindings.

Annotations
@Override
getBindingsback to summary
pack-priv List<Binding> getBindings(Class<?> carrier, MemoryLayout layout, TypeClass argumentClass, boolean isVariadicArg)