Interface TypedAccessGen

All Known Subinterfaces:
ExportsLegAccessGen, MethodAccessGen, MpTypedAccessGen
All Known Implementing Classes:
DoubleReadGen, DoubleWriteGen, FloatReadGen, FloatWriteGen, IntReadGen, IntWriteGen, LongReadGen, LongWriteGen, MpIntReadGen, MpIntWriteGen

public interface TypedAccessGen
A generator to emit code that accesses variables of various size in a state, for a specific type, byte order, and access.

This is used by variable birthing and retirement as well as direct memory accesses. Dynamic memory accesses, i.e., load and store op do not use this, though they may borrow some portions.

  • Method Details

    • lookupReader

      static TypedAccessGen lookupReader(Endian endian, JitType type)
      Lookup the generator for reading variables for the given type
      Parameters:
      endian - the byte order
      type - the variable's type
      Returns:
      the access generator
    • lookupWriter

      static TypedAccessGen lookupWriter(Endian endian, JitType type)
      Lookup the generator for writing variables for the given type
      Parameters:
      endian - the byte order
      type - the variable's type
      Returns:
      the access generator
    • generateCode

      void generateCode(JitCodeGenerator gen, Varnode vn, org.objectweb.asm.MethodVisitor rv)
      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.

      Parameters:
      gen - the code generator
      vn - the varnode
      rv - the method visitor