Record Class JitAllocationModel.MultiLocalVarHandler

java.lang.Object
java.lang.Record
ghidra.pcode.emu.jit.analysis.JitAllocationModel.MultiLocalVarHandler
Record Components:
parts - the parts describing how the locals are composed
type - the p-code type of the (whole) variable
All Implemented Interfaces:
JitAllocationModel.VarHandler
Enclosing class:
JitAllocationModel

public static record JitAllocationModel.MultiLocalVarHandler(List<JitAllocationModel.MultiLocalPart> parts, JitType type) extends Record implements JitAllocationModel.VarHandler
The handler for a variable allocated in a composition of locals

This can also handle a varnode that is a subpiece of a local variable allocated for a larger varnode. For example, this may handle EAX, when we have allocated a long to hold all of RAX.

  • Constructor Details

    • MultiLocalVarHandler

      public MultiLocalVarHandler(List<JitAllocationModel.MultiLocalPart> parts, JitType type)
      Creates an instance of a MultiLocalVarHandler record class.
      Parameters:
      parts - the value for the parts record component
      type - the value for the type record component
  • Method Details

    • generateInitCode

      public void generateInitCode(JitCodeGenerator gen, org.objectweb.asm.MethodVisitor iv)
      Description copied from interface: JitAllocationModel.VarHandler
      Emit bytecode into the class constructor.
      Specified by:
      generateInitCode in interface JitAllocationModel.VarHandler
      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)
      Description copied from interface: JitAllocationModel.VarHandler
      If needed, emit bytecode at the top of the run method.
      Specified by:
      generateDeclCode in interface JitAllocationModel.VarHandler
      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(JitCodeGenerator gen, JitType type, org.objectweb.asm.MethodVisitor rv)
      Description copied from interface: JitAllocationModel.VarHandler
      Emit bytecode to load the varnode's value onto the JVM stack.
      Specified by:
      generateLoadCode in interface JitAllocationModel.VarHandler
      Parameters:
      gen - the code generator
      type - the p-code type of the value expected on the JVM stack by the proceeding bytecode
      rv - the visitor for the run method
    • generateStoreCode

      public void generateStoreCode(JitCodeGenerator gen, JitType type, org.objectweb.asm.MethodVisitor rv)
      Description copied from interface: JitAllocationModel.VarHandler
      Emit bytecode to load the varnode's value onto the JVM stack.
      Specified by:
      generateStoreCode in interface JitAllocationModel.VarHandler
      Parameters:
      gen - the code generator
      type - the p-code type of the value produced on the JVM stack by the preceding bytecode
      rv - the visitor for the run 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. All components in this record class are compared with Objects::equals(Object,Object).
      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.
    • parts

      Returns the value of the parts record component.
      Returns:
      the value of the parts record component
    • type

      public JitType type()
      Returns the value of the type record component.
      Specified by:
      type in interface JitAllocationModel.VarHandler
      Returns:
      the value of the type record component