Interface ExportsLegAccessGen

All Superinterfaces:
TypedAccessGen
All Known Implementing Classes:
IntReadGen, IntWriteGen

public interface ExportsLegAccessGen extends TypedAccessGen
A generator that exports part of its implementation for use in a MpTypedAccessGen.

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 Summary

    Modifier and Type
    Method
    Description
    default void
    generateCode(JitCodeGenerator gen, Varnode vn, org.objectweb.asm.MethodVisitor rv)
    Emit code to access a varnode.
    void
    generateMpCodeLeg(JitCodeGenerator gen, AddressSpace space, long block, int off, int size, org.objectweb.asm.MethodVisitor rv)
    Emit code to access one JVM int, either a whole variable or one leg of a multi-precision int variable.
  • Method Details

    • generateMpCodeLeg

      void generateMpCodeLeg(JitCodeGenerator gen, AddressSpace space, long block, int off, int size, org.objectweb.asm.MethodVisitor rv)
      Emit code to access one JVM int, either a whole variable or one leg of a multi-precision int variable.

      Legs that span blocks are handled as in generateCode(JitCodeGenerator, Varnode, MethodVisitor).

      Parameters:
      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)
      rv - the method visitor
    • generateCode

      default void generateCode(JitCodeGenerator gen, Varnode vn, org.objectweb.asm.MethodVisitor rv)
      Description copied from interface: TypedAccessGen
      Emit code to access a varnode.

      If reading, the result is placed on the JVM stack. If writing, the value is popped from the JVM stack.

      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. If reading, the results are reassembled into a single value and pushed onto the JVM stack.

      Specified by:
      generateCode in interface TypedAccessGen
      Parameters:
      gen - the code generator
      vn - the varnode
      rv - the method visitor