Record Class JitType.MpIntJitType

java.lang.Object
java.lang.Record
ghidra.pcode.emu.jit.analysis.JitType.MpIntJitType
Record Components:
size - the size in bytes
All Implemented Interfaces:
JitType
Enclosing interface:
JitType

public static record JitType.MpIntJitType(int size) extends Record implements JitType
WIP: The p-code types for integers of size 9 and greater.
  • Constructor Details

    • MpIntJitType

      public MpIntJitType(int size)
      Creates an instance of a MpIntJitType record class.
      Parameters:
      size - the value for the size record component
  • Method Details

    • forSize

      public static JitType.MpIntJitType forSize(int size)
      Get the type for an integer of the given size 9 or greater
      Parameters:
      size - the size in bytes
      Returns:
      the type
      Throws:
      IllegalArgumentException - for any size 8 or less
    • pref

      public int pref()
      Description copied from interface: JitType
      The preference for this type. Smaller is more preferred.
      Specified by:
      pref in interface JitType
      Returns:
      the preference
    • nm

      public String nm()
      Description copied from interface: JitType
      Part of the name of a JVM local variable allocated for this type
      Specified by:
      nm in interface JitType
      Returns:
      the "type" part of a JVM local's name
    • legsAlloc

      public int legsAlloc()
      The total number of JVM int variables ("legs") required to store the int
      Returns:
      the total number of legs
    • legsWhole

      public int legsWhole()
      The number of legs that are filled
      Returns:
      the number of whole legs
    • partialSize

      public int partialSize()
      The number of bytes filled in the last leg, if partial
      Returns:
      the number of bytes in the partial leg, or 0 if all legs are whole
    • legTypes

      public List<JitType.SimpleJitType> legTypes()
      Get the p-code type that describes the part of the variable in each leg

      Each whole leg will have the type JitType.IntJitType.I4, and the partial leg, if applicable, will have its appropriate smaller integer type.

      Returns:
      the list of types, each fitting in a JVM int.
    • ext

      public JitType.MpIntJitType ext()
      Description copied from interface: JitType
      Extend this p-code type to the p-code type that fills its entire host JVM type.

      This is useful, e.g., when multiplying two int3 values using imul that the result might be an int4 and so may need additional conversion.

      Specified by:
      ext in interface JitType
      Returns:
      the extended type
    • toString

      public final String toString()
      Returns a string representation of this record class. The representation contains the name of the class, followed by the name and value of each of the record components.
      Specified by:
      toString in class Record
      Returns:
      a string representation of this object
    • hashCode

      public final int hashCode()
      Returns a hash code value for this object. The value is derived from the hash code of each of the record components.
      Specified by:
      hashCode in class Record
      Returns:
      a hash code value for this object
    • equals

      public final boolean equals(Object o)
      Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared with '=='.
      Specified by:
      equals in class Record
      Parameters:
      o - the object with which to compare
      Returns:
      true if this object is the same as the o argument; false otherwise.
    • size

      public int size()
      Returns the value of the size record component.
      Specified by:
      size in interface JitType
      Returns:
      the value of the size record component