Interface ExportsLegAccessGen

All Superinterfaces:
AccessGen<JitType.IntJitType>, SimpleAccessGen<Types.TInt,JitType.IntJitType>
All Known Implementing Classes:
IntAccessGen

public interface ExportsLegAccessGen extends SimpleAccessGen<Types.TInt,JitType.IntJitType>
A generator that exports part of its implementation for use in a MpIntAccessGen.

This really just avoids the re-creation of Varnode objects for each leg of a large varnode. The method instead takes the (space,offset,size) triple as well as the offset of the block containing its start.

  • Method Details

    • genReadLegToStack

      <THIS extends JitCompiledPassage, N extends Emitter.Next> Emitter<Emitter.Ent<N,Types.TInt>> genReadLegToStack(Emitter<N> em, Local<Types.TRef<THIS>> localThis, JitCodeGenerator<THIS> gen, AddressSpace space, long block, int off, int size)
      Emit code to read one JVM int, either a whole variable or one leg of a multi-precision int variable.

      Legs that span blocks are handled as in genReadToStack(Emitter, Local, JitCodeGenerator, Varnode)

      Type Parameters:
      THIS - the type of the generated passage
      N - the incoming stack
      Parameters:
      em - the emitter typed with the incoming stack
      localThis - a handle to the local holding the this reference
      gen - the code generator
      space - the address space of the varnode
      block - the block offset containing the varnode (or leg)
      off - the offset of the varnode (or leg)
      size - the size of the varnode in bytes (or leg)
      Returns:
      the emitter typed with the resulting stack, i.e., having pushed the value
    • genWriteLegFromStack

      <THIS extends JitCompiledPassage, N1 extends Emitter.Next, N0 extends Emitter.Ent<N1, Types.TInt>> Emitter<N1> genWriteLegFromStack(Emitter<N0> em, Local<Types.TRef<THIS>> localThis, JitCodeGenerator<THIS> gen, AddressSpace space, long block, int off, int size)
      Emit code to write one JVM int, either a whole variable or one leg of a multi-precision int variable.

      Legs that span blocks are handled as in genWriteFromStack(Emitter, Local, JitCodeGenerator, Varnode)

      Type Parameters:
      THIS - the type of the generated passage
      N1 - the tail of the incoming stack
      N0 - the incoming stack with the value on top
      Parameters:
      em - the emitter typed with the incoming stack
      localThis - a handle to the local holding the this reference
      gen - the code generator
      space - the address space of the varnode
      block - the block offset containing the varnode (or leg)
      off - the offset of the varnode (or leg)
      size - the size of the varnode in bytes (or leg)
      Returns:
      the emitter typed with the resulting stack, i.e., having popped the value
    • genReadToStack

      default <THIS extends JitCompiledPassage, N extends Emitter.Next> Emitter<Emitter.Ent<N,Types.TInt>> genReadToStack(Emitter<N> em, Local<Types.TRef<THIS>> localThis, JitCodeGenerator<THIS> gen, Varnode vn)
      Description copied from interface: SimpleAccessGen
      Emit code to read a varnode

      If the varnode fits completely in the block (the common case), then this accesses the bytes from the one block, using the method chosen by size. If the varnode extends into the next block, then this will split the varnode into two portions according to machine byte order. Each portion is accessed using the method for the size of that portion. The results are reassembled into a single operand.

      Specified by:
      genReadToStack in interface SimpleAccessGen<Types.TInt,JitType.IntJitType>
      Type Parameters:
      N - the incoming stack
      Parameters:
      em - the emitter typed with the incoming stack
      localThis - a handle to the local holding the this reference
      gen - the code generator
      vn - the varnode
      Returns:
      the code generator with the resulting stack, i.e., having pushed the value
    • genWriteFromStack

      default <THIS extends JitCompiledPassage, N1 extends Emitter.Next, N0 extends Emitter.Ent<N1, Types.TInt>> Emitter<N1> genWriteFromStack(Emitter<N0> em, Local<Types.TRef<THIS>> localThis, JitCodeGenerator<THIS> gen, Varnode vn)
      Description copied from interface: SimpleAccessGen
      Emit code to write a varnode

      If the varnode fits completely in the block (the common case), then this accesses the bytes from the one block, using the method chosen by size. If the varnode extends into the next block, then this will split the varnode into two portions according to machine byte order. Each portion is accessed using the method for the size of that portion.

      Specified by:
      genWriteFromStack in interface SimpleAccessGen<Types.TInt,JitType.IntJitType>
      Type Parameters:
      N1 - the tail of the incoming stack
      N0 - the incoming stack having the value on top
      Parameters:
      em - the emitter typed with the incoming stack
      localThis - a handle to the local holding the this reference
      gen - the code generator
      vn - the varnode
      Returns:
      the code generator with the resulting stack, i.e., having popped the value