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