Package ghidra.pcode.emu.jit.analysis

# Record Class JitType.IntJitType

java.lang.Object
java.lang.Record
ghidra.pcode.emu.jit.analysis.JitType.IntJitType

Record Components:
  `size` - the size in bytes

All Implemented Interfaces:
  `JitType`, `JitType.SimpleJitType`

Enclosing interface:
  `JitType`

public static record JitType.IntJitType(int size) extends Record implements JitType.SimpleJitType
The p-code types for integers of size 1 through 4, i.e., that fit in a JVM int.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface ghidra.pcode.emu.jit.analysis.JitType

  `JitType.DoubleJitType, JitType.FloatJitType, JitType.IntJitType, JitType.LongJitType, JitType.MpFloatJitType, JitType.MpIntJitType, JitType.SimpleJitType`

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final JitType.IntJitType`
  `I1`
  `int1`: a 1-byte integer
  `static final JitType.IntJitType`
  `I2`
  `int2`: a 2-byte integer
  `static final JitType.IntJitType`
  `I3`
  `int3`: a 3-byte integer
  `static final JitType.IntJitType`
  `I4`
  `int4`: a 4-byte integer

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `IntJitType(int size)`
  Compact constructor to check the size

- ## Method Summary

  Modifier and Type
  Method
  Description
  `JitType.IntJitType`
  `asInt()`
  Re-apply the `integer` behavior to this type
  `final boolean`
  `equals(Object o)`
  Indicates whether some other object is "equal to" this one.
  `JitType.IntJitType`
  `ext()`
  Extend this p-code type to the p-code type that fills its entire host JVM type.
  `static JitType.IntJitType`
  `forSize(int size)`
  Get the type for an integer of the given size 1 through 4
  `final int`
  `hashCode()`
  Returns a hash code value for this object.
  `Class<?>`
  `javaType()`
  The JVM type of the variable that can represent a p-code variable of this type
  `List<JitType.IntJitType>`
  `legTypes()`
  Get the p-code type that describes the part of the variable in each leg
  `String`
  `nm()`
  Part of the name of a JVM local variable allocated for this type
  `int`
  `opcodeLoad()`
  The JVM opcode to load a local variable of this type onto the stack
  `int`
  `opcodeStore()`
  The JVM opcode to store a local variable of this type from the stack
  `int`
  `pref()`
  The preference for this type.
  `int`
  `size()`
  Returns the value of the `size` record component.
  `final String`
  `toString()`
  Returns a string representation of this record class.

  ### Methods inherited from class java.lang.Object

  `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

- ## Field Details

  - ### I1

    public static final JitType.IntJitType I1
    `int1`: a 1-byte integer

  - ### I2

    public static final JitType.IntJitType I2
    `int2`: a 2-byte integer

  - ### I3

    public static final JitType.IntJitType I3
    `int3`: a 3-byte integer

  - ### I4

    public static final JitType.IntJitType I4
    `int4`: a 4-byte integer

- ## Constructor Details

  - ### IntJitType

    public IntJitType(int size)
    Compact constructor to check the size
    Parameters:
      `size` - the size in bytes

- ## Method Details

  - ### forSize

    public static JitType.IntJitType forSize(int size)
    Get the type for an integer of the given size 1 through 4
    Parameters:
      `size` - the size in bytes
    Returns:
      the type
    Throws:
      `IllegalArgumentException` - for any size not 1 through 4

  - ### 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

  - ### javaType

    public Class<?> javaType()
    Description copied from interface: `JitType.SimpleJitType`
    The JVM type of the variable that can represent a p-code variable of this type
    Specified by:
      `javaType` in interface `JitType.SimpleJitType`
    Returns:
      the primitive class (not boxed)

  - ### opcodeLoad

    public int opcodeLoad()
    Description copied from interface: `JitType.SimpleJitType`
    The JVM opcode to load a local variable of this type onto the stack
    Specified by:
      `opcodeLoad` in interface `JitType.SimpleJitType`
    Returns:
      the opcode

  - ### opcodeStore

    public int opcodeStore()
    Description copied from interface: `JitType.SimpleJitType`
    The JVM opcode to store a local variable of this type from the stack
    Specified by:
      `opcodeStore` in interface `JitType.SimpleJitType`
    Returns:
      the opcode

  - ### ext

    public JitType.IntJitType 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`
    Specified by:
      `ext` in interface `JitType.SimpleJitType`
    Returns:
      the extended type

  - ### asInt

    public JitType.IntJitType asInt()
    Description copied from interface: `JitType.SimpleJitType`
    Re-apply the `integer` behavior to this type

    This may be slightly faster than `JitTypeBehavior.INTEGER.resolve(this)`, because each type can pick its int type directly, and integer types can just return `this`.

    Specified by:
      `asInt` in interface `JitType.SimpleJitType`
    Returns:
      this type as an int

  - ### legTypes

    public List<JitType.IntJitType> legTypes()
    Description copied from interface: `JitType`
    Get the p-code type that describes the part of the variable in each leg

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

    Specified by:
      `legTypes` in interface `JitType`
    Returns:
      the list of types, each fitting in a JVM int, in big-endian order.

  - ### 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