Class CallingConvention
java.lang.Object
com.pnfsoftware.jeb.core.units.code.asm.type.CallingConvention
- All Implemented Interfaces:
ICallingConvention
Standard implementation of a calling convention object. It can be sub-classed to generate custom
input/output layout.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionclassStorage-location generator for routine arguments (inputs).classStorage-location generator for routine return values (outputs). -
Field Summary
Fields inherited from interface com.pnfsoftware.jeb.core.units.code.asm.type.ICallingConvention
FLAG_COMPOSITE_INPUT_ON_STACK, FLAG_FIRST_ARG_IS_THIS_POINTER, FLAG_FLOAT_INPUT_ON_STACK, FLAG_FORBID_PARAMS_2SLOTSUP, FLAG_FORBID_PARAMS_3SLOTSUP, FLAG_IPRD, FLAG_LINK_AFTER_INPUT, FLAG_OUTPUT_AFTER_INPUT, FLAG_OUTPUT_PUSHED, FLAG_PARALLEL_INPUT_REGISTER_STACKS, FLAG_SKIP_PASSED_INPUT_REGISTERS, FLAG_STACK_CLEANED_BY_CALLEE -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()intdetermineSlotcountAlignment(int requestedSlotcount) Determine the slotcount alignment requirement of a non-compositetype.format(int type) Get a list of alternate names for this calling convention.Get the list of compiler types this calling convention may work with.intgetFlags()longGet an internally-generated identifier for this calling convention object.Create a storage-location generator for the inputs provided to a routine using this calling convention.intReturn the number of slots that are reserved for parameters.Retrieve the optional calling convention, derived from this convention, used to return large composite prototypes.intgetName()Get the common name of this calling convention.getNames()Retrieve all names for this calling convention (principal and alternates).getNotes()getOutput(TypeLayoutInfo ti, int inputStackSlotCount) Convenience method to retrieve the storage location of the single return value for this calling convention.getOutputsGenerator(int inputStackSlotCount) Create a storage-location generator for the outputs provided to a routine using this calling convention.intReturn the number of slots that are reserved for return values.Get the list of processor types this calling convention may work with.Get the list of registers that are spoiled by a callee, in the strictest sense, i.e.getReturnAddressSlot(Integer inputStackSlotCount) Alignment specifications for non-compositetypes.Get the list of all registers that may be modified and/or spoiled by a callee, in the most general sense.Get the list of subsystem types this calling convention may work with.booleanhasFlag(int f) booleanisCompatibleWith(ProcessorType wantedProcessor, SubsystemType wantedSubsystem, CompilerType wantedCompiler) Determine whether this calling convention is compatible with the provided triple (processor, subsystem, compiler).booleantoString()Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.pnfsoftware.jeb.core.units.code.asm.type.ICallingConvention
isStackCleanedByCallee, isStackCleanedByCaller
-
Constructor Details
-
CallingConvention
public CallingConvention()Reserved.
-
-
Method Details
-
clone
-
getIdentifierKey
public long getIdentifierKey()Description copied from interface:ICallingConventionGet an internally-generated identifier for this calling convention object. The id is generated using:- the same names
- same flags
- same processor targets
- same subsystem targets
- same compiler targets
- Specified by:
getIdentifierKeyin interfaceICallingConvention- Returns:
- the key for this calling convention
-
getNotes
- Specified by:
getNotesin interfaceICallingConvention- Returns:
-
getFlags
public int getFlags()- Specified by:
getFlagsin interfaceICallingConvention- Returns:
-
hasFlag
public boolean hasFlag(int f) - Specified by:
hasFlagin interfaceICallingConvention- Returns:
-
isUnknown
public boolean isUnknown()- Specified by:
isUnknownin interfaceICallingConvention- Returns:
-
getName
Description copied from interface:ICallingConventionGet the common name of this calling convention.- Specified by:
getNamein interfaceICallingConvention- Returns:
-
getAlternateNames
Description copied from interface:ICallingConventionGet a list of alternate names for this calling convention.- Specified by:
getAlternateNamesin interfaceICallingConvention- Returns:
-
getNames
Description copied from interface:ICallingConventionRetrieve all names for this calling convention (principal and alternates).- Specified by:
getNamesin interfaceICallingConvention- Returns:
-
getPrimaryProcessorType
-
getProcessorTypes
Description copied from interface:ICallingConventionGet the list of processor types this calling convention may work with.- Specified by:
getProcessorTypesin interfaceICallingConvention- Returns:
-
getSubsystemTypes
Description copied from interface:ICallingConventionGet the list of subsystem types this calling convention may work with.- Specified by:
getSubsystemTypesin interfaceICallingConvention- Returns:
-
getCompilerTypes
Description copied from interface:ICallingConventionGet the list of compiler types this calling convention may work with.- Specified by:
getCompilerTypesin interfaceICallingConvention- Returns:
-
isCompatibleWith
public boolean isCompatibleWith(ProcessorType wantedProcessor, SubsystemType wantedSubsystem, CompilerType wantedCompiler) Description copied from interface:ICallingConventionDetermine whether this calling convention is compatible with the provided triple (processor, subsystem, compiler).- Specified by:
isCompatibleWithin interfaceICallingConvention- Parameters:
wantedProcessor- mandatory (pass UNKNOWN if not known)wantedSubsystem- mandatory (pass UNKNOWN if not known)wantedCompiler- mandatory (pass UNKNOWN if not known)- Returns:
-
getSpoiledRegisters
Description copied from interface:ICallingConventionGet the list of all registers that may be modified and/or spoiled by a callee, in the most general sense. That set would include any type of return registers.- Specified by:
getSpoiledRegistersin interfaceICallingConvention- Returns:
-
getPureSpoiledRegisters
Description copied from interface:ICallingConventionGet the list of registers that are spoiled by a callee, in the strictest sense, i.e. their value may or may not be modified, but it is meaningless and should not be interpreted by the caller upon return. That set would NOT include return registers.- Specified by:
getPureSpoiledRegistersin interfaceICallingConvention- Returns:
-
getReturnAddressSlot
- Specified by:
getReturnAddressSlotin interfaceICallingConvention- Returns:
-
getReturnAddressSlot
- Specified by:
getReturnAddressSlotin interfaceICallingConvention- Returns:
-
getOutput
Description copied from interface:ICallingConventionConvenience method to retrieve the storage location of the single return value for this calling convention. Most calling conventions allow the return of a single value.- Specified by:
getOutputin interfaceICallingConvention- Parameters:
ti- storage typeinputStackSlotCount- the number of stack slots used to provide input parameters (some calling conventions require that to calculate proper positioning for output values)- Returns:
-
getInputSlotCountHint
public int getInputSlotCountHint()Description copied from interface:ICallingConventionReturn the number of slots that are reserved for parameters. Note that this is just a hint on how many parameters are used.- Specified by:
getInputSlotCountHintin interfaceICallingConvention- Returns:
-
getOutputSlotCountHint
public int getOutputSlotCountHint()Description copied from interface:ICallingConventionReturn the number of slots that are reserved for return values. Note that this is just a hint on how many return values are defined.- Specified by:
getOutputSlotCountHintin interfaceICallingConvention- Returns:
-
getSlotcountAlignmentMap
Description copied from interface:ICallingConventionAlignment specifications for non-compositetypes.- Specified by:
getSlotcountAlignmentMapin interfaceICallingConvention- Returns:
-
determineSlotcountAlignment
public int determineSlotcountAlignment(int requestedSlotcount) Description copied from interface:ICallingConventionDetermine the slotcount alignment requirement of a non-compositetype.- Specified by:
determineSlotcountAlignmentin interfaceICallingConvention- Returns:
-
getIPRDMinimumSlotCount
public int getIPRDMinimumSlotCount()- Specified by:
getIPRDMinimumSlotCountin interfaceICallingConvention- Returns:
-
getIPRDInputPtrEntry
- Specified by:
getIPRDInputPtrEntryin interfaceICallingConvention- Returns:
-
getIPRDOutputPtrEntry
- Specified by:
getIPRDOutputPtrEntryin interfaceICallingConvention- Returns:
-
getIPRDConvention
Description copied from interface:ICallingConventionRetrieve the optional calling convention, derived from this convention, used to return large composite prototypes. This only applies if the flagICallingConvention.FLAG_IPRDwas set.- Specified by:
getIPRDConventionin interfaceICallingConvention- Returns:
- a linked IPRD (Implicit Pointer to Return Data) convention, or null
-
toString
-
format
- Specified by:
formatin interfaceICallingConvention- Parameters:
type- 0: short-form (i.e.,#toString()), 1: user-friendly long-form, 2: parseable yaml form- Returns:
-
formatParseable
-
formatUser
-
getInputsGenerator
Description copied from interface:ICallingConventionCreate a storage-location generator for the inputs provided to a routine using this calling convention. convention.- Specified by:
getInputsGeneratorin interfaceICallingConvention- Returns:
- a generator
-
getOutputsGenerator
Description copied from interface:ICallingConventionCreate a storage-location generator for the outputs provided to a routine using this calling convention.- Specified by:
getOutputsGeneratorin interfaceICallingConvention- Parameters:
inputStackSlotCount- optional value indicating how many stack slots were used to provide parameters (this value is the calling convention has the flagsICallingConvention.FLAG_OUTPUT_AFTER_INPUTorICallingConvention.FLAG_OUTPUT_PUSHED)- Returns:
- a generator
-