Record Class LongVarAlloc

java.lang.Object
java.lang.Record
ghidra.pcode.emu.jit.alloc.LongVarAlloc
Record Components:
local - the JVM local
type - the p-code type
All Implemented Interfaces:
SimpleVarHandler<Types.TLong,JitType.LongJitType>, VarHandler

The handler for a p-code variable allocated in one JVM long.
  • Constructor Details

  • Method Details

    • genLoadLegToStack

      public <N extends Emitter.Next> Emitter<Emitter.Ent<N,Types.TInt>> genLoadLegToStack(Emitter<N> em, JitCodeGenerator<?> gen, JitType.MpIntJitType type, int leg, Opnd.Ext ext)
      Description copied from interface: VarHandler
      Emit bytecode to load one leg of a multi-precision value from the varnode onto the JVM stack.
      Specified by:
      genLoadLegToStack in interface VarHandler
      Type Parameters:
      N - the incoming stack
      Parameters:
      em - the emitter typed with the incoming stack
      gen - the code generator
      type - the p-code type of the complete multi-precision value
      leg - the index of the leg to load, 0 being least significant
      ext - the kind of extension to apply
      Returns:
      the emitter typed with the resulting stack, i.e., having the int leg pushed onto it
    • getConvToStack

      Description copied from interface: SimpleVarHandler
      Get the converter of multi-precision integers to the stack type of this handler's local.

      Note that the converter need only extract the least 1 or 2 legs of the source multi-precision int, depending on the category of the destination's type. The converter knows how to handle both the operand (series of locals) and array forms.

      Specified by:
      getConvToStack in interface SimpleVarHandler<Types.TLong,JitType.LongJitType>
      Returns:
      the converter
    • genLoadToBool

      public <N extends Emitter.Next> Emitter<Emitter.Ent<N,Types.TInt>> genLoadToBool(Emitter<N> em, JitCodeGenerator<?> gen)
      Description copied from interface: VarHandler
      Emit bytecode to load the varnode's value, interpreted as a boolean, as an integer onto the JVM stack.
      Specified by:
      genLoadToBool in interface VarHandler
      Type Parameters:
      N - the incoming stack
      Parameters:
      em - the emitter typed with the incoming stack
      gen - the code generator
      Returns:
      the emitter typed with the resulting stack, i.e., having the int boolean pushed onto it
    • subpiece

      public VarHandler subpiece(Endian endian, int byteOffset, int maxByteSize)
      Description copied from interface: VarHandler
      Create a handler for a PcodeOp.SUBPIECE of a value.

      To implement subpiece, we could load the entire varnode and then extract the designated portion. Or, we could load only the designated portion, averting any code and execution cost of loading the un-designated portions. We accomplish this by re-writing the subpiece op and a load of the sub-varnode.

      Specified by:
      subpiece in interface VarHandler
      Parameters:
      endian - the endianness of the emulation target
      byteOffset - the number of least-significant bytes to remove
      maxByteSize - the maximum size of the resulting variable. In general, a subpiece should never exceed the size of the parent varnode, but if it does, this will truncate that excess.
      Returns:
      the resulting subpiece handler
    • 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.
    • local

      Returns the value of the local record component.
      Specified by:
      local in interface SimpleVarHandler<Types.TLong,JitType.LongJitType>
      Returns:
      the value of the local record component
    • type

      public JitType.LongJitType type()
      Returns the value of the type record component.
      Specified by:
      type in interface SimpleVarHandler<Types.TLong,JitType.LongJitType>
      Specified by:
      type in interface VarHandler
      Returns:
      the value of the type record component