Record Class JitAllocationModel.MultiLocalPart

java.lang.Object
java.lang.Record
ghidra.pcode.emu.jit.analysis.JitAllocationModel.MultiLocalPart
Record Components:
local - the local variable allocated to this part
shift - the number of bytes and direction to shift
Enclosing class:
JitAllocationModel

public static record JitAllocationModel.MultiLocalPart(JitAllocationModel.JvmLocal local, int shift) extends Record
A portion of a multi-local variable handler.

This portion is allocated in a JVM local. When loading with a positive shift, the value is shifted to the right to place it into position.

  • Constructor Details

    • MultiLocalPart

      public MultiLocalPart(JitAllocationModel.JvmLocal local, int shift)
      Creates an instance of a MultiLocalPart record class.
      Parameters:
      local - the value for the local record component
      shift - the value for the shift record component
  • Method Details

    • generateLoadCode

      public void generateLoadCode(JitCodeGenerator gen, JitType type, org.objectweb.asm.MethodVisitor rv)
      Emit bytecode to load the value from this local and position it in a value on the JVM stack.

      If multiple parts are to be combined, the caller should emit a bitwise or after all loads but the first.

      Parameters:
      gen - the code generator
      type - the p-code type of the value expected on the stack by the proceeding bytecode, which may be to load additional parts
      rv - the visitor for the run method
    • generateStoreCode

      public void generateStoreCode(JitCodeGenerator gen, JitType type, org.objectweb.asm.MethodVisitor rv)
      Emit bytecode to extract this part from the value on the JVM stack and store it in the local variable.

      If multiple parts are to be stored, the caller should emit a dup or dup2 before all stores but the last.

      Parameters:
      gen - the code generator
      type - the p-code type of the value expected on the stack by the proceeding bytecode, which may be to load additional parts
      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. 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.
    • local

      Returns the value of the local record component.
      Returns:
      the value of the local record component
    • shift

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