Package ghidra.pcode.emu.jit.analysis

# Record Class JitAllocationModel.JvmLocal

java.lang.Object
java.lang.Record
ghidra.pcode.emu.jit.analysis.JitAllocationModel.JvmLocal

Record Components:
  `index` - the index reserved for this local
  `name` - the human-readable name for this local
  `type` - a type for this local
  `vn` - the varnode whose value this local holds

Enclosing class:
  `JitAllocationModel`

public static record JitAllocationModel.JvmLocal(int index, String name, JitType.SimpleJitType type, Varnode vn) extends Record
An allocated JVM local

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `JvmLocal(int index, String name, JitType.SimpleJitType type, Varnode vn)`
  Creates an instance of a `JvmLocal` record class.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `final boolean`
  `equals(Object o)`
  Indicates whether some other object is "equal to" this one.
  `void`
  `generateBirthCode(JitCodeGenerator gen, org.objectweb.asm.MethodVisitor rv)`
  Emit bytecode to bring this varnode into scope.
  `void`
  `generateDeclCode(JitCodeGenerator gen, org.objectweb.asm.Label start, org.objectweb.asm.Label end, org.objectweb.asm.MethodVisitor rv)`
  Emit bytecode at the top of the `run` method.
  `void`
  `generateInitCode(JitCodeGenerator gen, org.objectweb.asm.MethodVisitor iv)`
  Emit bytecode into the class constructor.
  `void`
  `generateLoadCode(org.objectweb.asm.MethodVisitor rv)`
  Emit bytecode to load the varnode's value onto the JVM stack.
  `void`
  `generateRetireCode(JitCodeGenerator gen, org.objectweb.asm.MethodVisitor rv)`
  Emit bytecode to take this varnode out of scope.
  `void`
  `generateStoreCode(org.objectweb.asm.MethodVisitor rv)`
  Emit bytecode to store the value on the JVM stack into the varnode.
  `final int`
  `hashCode()`
  Returns a hash code value for this object.
  `int`
  `index()`
  Returns the value of the `index` record component.
  `Address`
  `maxPrimAddr()`
  Returns the maximum address that would be occupied by the full primitive type.
  `String`
  `name()`
  Returns the value of the `name` record component.
  `final String`
  `toString()`
  Returns a string representation of this record class.
  `JitType.SimpleJitType`
  `type()`
  Returns the value of the `type` record component.
  `Varnode`
  `vn()`
  Returns the value of the `vn` record component.

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

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

- ## Constructor Details

  - ### JvmLocal

    public JvmLocal(int index, String name, JitType.SimpleJitType type, Varnode vn)
    Creates an instance of a `JvmLocal` record class.
    Parameters:
      `index` - the value for the `index` record component
      `name` - the value for the `name` record component
      `type` - the value for the `type` record component
      `vn` - the value for the `vn` record component

- ## Method Details

  - ### generateInitCode

    public void generateInitCode(JitCodeGenerator gen, org.objectweb.asm.MethodVisitor iv)
    Emit bytecode into the class constructor.
    Parameters:
      `gen` - the code generator
      `iv` - the visitor for the class constructor

  - ### generateDeclCode

    public void generateDeclCode(JitCodeGenerator gen, org.objectweb.asm.Label start, org.objectweb.asm.Label end, org.objectweb.asm.MethodVisitor rv)
    Emit bytecode at the top of the `run` method.

    This will declare all of the allocated locals for the entirety of the method.

    Parameters:
      `gen` - the code generator
      `start` - a label at the top of the method
      `end` - a label at the end of the method
      `rv` - the visitor for the run method

  - ### generateLoadCode

    public void generateLoadCode(org.objectweb.asm.MethodVisitor rv)
    Emit bytecode to load the varnode's value onto the JVM stack.
    Parameters:
      `rv` - the visitor for the `run` method

  - ### generateStoreCode

    public void generateStoreCode(org.objectweb.asm.MethodVisitor rv)
    Emit bytecode to store the value on the JVM stack into the varnode.
    Parameters:
      `rv` - the visitor for the `run` method

  - ### generateBirthCode

    public void generateBirthCode(JitCodeGenerator gen, org.objectweb.asm.MethodVisitor rv)
    Emit bytecode to bring this varnode into scope.

    This will copy the value from the `state` into the local variable.

    Parameters:
      `gen` - the code generator
      `rv` - the visitor for the `run` method

  - ### generateRetireCode

    public void generateRetireCode(JitCodeGenerator gen, org.objectweb.asm.MethodVisitor rv)
    Emit bytecode to take this varnode out of scope.

    This will copy the value from the local variable into the `state`.

    Parameters:
      `gen` - the code generator
      `rv` - the visitor for the `JitCompiledPassage.run(int)` method

  - ### maxPrimAddr

    public Address maxPrimAddr()
    Returns the maximum address that would be occupied by the full primitive type.
    Returns:
      the maximum address that would be occupied by the full primitive 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. Reference components are compared with `Objects::equals(Object,Object)`; primitive components 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.

  - ### index

    public int index()
    Returns the value of the `index` record component.
    Returns:
      the value of the `index` record component

  - ### name

    public String name()
    Returns the value of the `name` record component.
    Returns:
      the value of the `name` record component

  - ### type

    public JitType.SimpleJitType type()
    Returns the value of the `type` record component.
    Returns:
      the value of the `type` record component

  - ### vn

    public Varnode vn()
    Returns the value of the `vn` record component.
    Returns:
      the value of the `vn` record component