Package ghidra.pcode.emu.jit.gen.var

# Interface MemoryVarGen<V extends JitVarnodeVar>

Type Parameters:
  `V` - the class of p-code variable node in the use-def graph

All Superinterfaces:
  `ValGen<V>`, `VarGen<V>`

All Known Implementing Classes:
  `DirectMemoryVarGen`, `MemoryOutVarGen`

public interface MemoryVarGen<V extends JitVarnodeVar> extends VarGen<V>
The generator for memory variables.

These variables affect the `state` immediately, i.e., they are not birthed or retired as local JVM variables. The generator delegates to the appropriate `TypedAccessGen` for this variable's varnode and assigned type.

- ## Nested Class Summary

  ## Nested classes/interfaces inherited from interface ghidra.pcode.emu.jit.gen.var.VarGen

  `VarGen.BlockTransition`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `default void`
  `generateValInitCode(JitCodeGenerator gen, V v, org.objectweb.asm.MethodVisitor iv)`
  Prepare any class-level items required to use this variable
  `default JitType`
  `generateValReadCode(JitCodeGenerator gen, V v, JitTypeBehavior typeReq, TypeConversions.Ext ext, org.objectweb.asm.MethodVisitor rv)`
  Read the value onto the stack

  ### Methods inherited from interface ghidra.pcode.emu.jit.gen.var.VarGen

  `generateVarWriteCode`

- ## Method Details

  - ### generateValInitCode

    default void generateValInitCode(JitCodeGenerator gen, V v, org.objectweb.asm.MethodVisitor iv)
    Description copied from interface: `ValGen`
    Prepare any class-level items required to use this variable

    For example, if this represents a direct memory variable, then this can prepare a reference to the portion of the state involved, allowing it to access it readily.

    Specified by:
      `generateValInitCode` in interface `ValGen<V extends JitVarnodeVar>`
    Parameters:
      `gen` - the code generator
      `v` - the value
      `iv` - the constructor visitor

  - ### generateValReadCode

    default JitType generateValReadCode(JitCodeGenerator gen, V v, JitTypeBehavior typeReq, TypeConversions.Ext ext, org.objectweb.asm.MethodVisitor rv)
    Description copied from interface: `ValGen`
    Read the value onto the stack
    Specified by:
      `generateValReadCode` in interface `ValGen<V extends JitVarnodeVar>`
    Parameters:
      `gen` - the code generator
      `v` - the value to read
      `typeReq` - the required type of the value
      `ext` - the kind of extension to apply when adjusting from JVM size to varnode size
      `rv` - the visitor for the `run` method
    Returns:
      the actual p-code type (which determines the JVM type) of the value on the stack