Class PrototypeModel

  • Direct Known Subclasses:
    PrototypeModelMerged

    public class PrototypeModel
    extends java.lang.Object
    A function calling convention model. Formal specification of how a compiler passes arguments between functions.
    • Field Detail

      • name

        protected java.lang.String name
    • Constructor Detail

      • PrototypeModel

        public PrototypeModel​(java.lang.String name,
                              PrototypeModel model)
      • PrototypeModel

        public PrototypeModel()
    • Method Detail

      • isMerged

        public boolean isMerged()
      • getName

        public java.lang.String getName()
      • getExtrapop

        public int getExtrapop()
      • getStackshift

        public int getStackshift()
      • hasThisPointer

        public boolean hasThisPointer()
      • isConstructor

        public boolean isConstructor()
      • getReturnLocation

        @Deprecated
        public VariableStorage getReturnLocation​(DataType dataType,
                                                 Program program)
        Deprecated.
        Get the preferred return location given the specified dataType. In truth, there is no one location. The routines that use this method tend to want the default storage location for integer or pointer return values.
        Parameters:
        dataType - first parameter dataType or null for a default undefined type.
        program -
        Returns:
        return location or VariableStorage.UNASSIGNED_STORAGE if unable to determine suitable location
      • getNextArgLocation

        public VariableStorage getNextArgLocation​(Parameter[] params,
                                                  DataType dataType,
                                                  Program program)
        Get the preferred parameter location for a new parameter which will appended to the end of an existing set of params. If existing parameters use custom storage, this method should not be used.
        Parameters:
        params - existing set parameters to which the next parameter will be appended. (may be null)
        dataType - dataType associated with next parameter location or null for a default undefined type.
        program -
        Returns:
        next parameter location or VariableStorage.UNASSIGNED_STORAGE if unable to determine suitable location
      • getArgLocation

        public VariableStorage getArgLocation​(int argIndex,
                                              Parameter[] params,
                                              DataType dataType,
                                              Program program)
        Get the preferred parameter location for a specified parameter specified by argIndex which will be added/inserted within the set of existing function params. If existing parameters use custom storage, this method should not be used.
        Parameters:
        params - existing set parameters to which the parameter specified by argIndex will be added/inserted be appended (may be null).
        dataType - dataType associated with next parameter location or null for a default undefined type.
        program -
        Returns:
        parameter location or VariableStorage.UNASSIGNED_STORAGE if unable to determine suitable location
      • getStorageLocations

        public VariableStorage[] getStorageLocations​(Program program,
                                                     DataType[] dataTypes,
                                                     boolean addAutoParams)
        Compute the variable storage for a given function and set of return/parameter datatypes defined by an array of data types.
        Parameters:
        program -
        dataTypes - return/parameter datatypes (first element is always the return datatype, i.e., minimum array length is 1)
        addAutoParams - TODO
        Returns:
        dynamic storage locations orders by ordinal where first element corresponds to return storage. The returned array may also include additional auto-parameter storage locations.
      • getStackParameterAlignment

        public int getStackParameterAlignment()
      • getStackParameterOffset

        public java.lang.Long getStackParameterOffset()
      • getPotentialInputRegisterStorage

        public VariableStorage[] getPotentialInputRegisterStorage​(Program prog)
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object