Package ghidra.pcode.emu.jit.analysis

# Interface JitAllocationModel.VarHandler

All Known Subinterfaces:
  `JitAllocationModel.OneLocalVarHandler`

All Known Implementing Classes:
  `JitAllocationModel.DoubleVarAlloc`, `JitAllocationModel.FloatVarAlloc`, `JitAllocationModel.IntVarAlloc`, `JitAllocationModel.LongVarAlloc`, `JitAllocationModel.MultiLocalVarHandler`, `JitAllocationModel.NoHandler`

Enclosing class:
  `JitAllocationModel`

public static interface JitAllocationModel.VarHandler
A handler that knows how to load and store variable values onto and from the JVM stack.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `generateDeclCode(JitCodeGenerator gen, org.objectweb.asm.Label start, org.objectweb.asm.Label end, org.objectweb.asm.MethodVisitor rv)`
  If needed, emit bytecode at the top of the `run` method.
  `void`
  `generateInitCode(JitCodeGenerator gen, org.objectweb.asm.MethodVisitor iv)`
  Emit bytecode into the class constructor.
  `void`
  `generateLoadCode(JitCodeGenerator gen, JitType type, TypeConversions.Ext ext, org.objectweb.asm.MethodVisitor rv)`
  Emit bytecode to load the varnode's value onto the JVM stack.
  `void`
  `generateStoreCode(JitCodeGenerator gen, JitType type, TypeConversions.Ext ext, org.objectweb.asm.MethodVisitor rv)`
  Emit bytecode to load the varnode's value onto the JVM stack.
  `JitType`
  `type()`
  Get the p-code type of the variable this handler handles.

- ## Method Details

  - ### type

    JitType type()
    Get the p-code type of the variable this handler handles.
    Returns:
      the type

  - ### generateInitCode

    void generateInitCode(JitCodeGenerator gen, org.objectweb.asm.MethodVisitor iv)
    Emit bytecode into the class constructor.
    Parameters:
      `gen` - the code generator
      `iv` - the visitor for the class constructor

  - ### generateDeclCode

    void generateDeclCode(JitCodeGenerator gen, org.objectweb.asm.Label start, org.objectweb.asm.Label end, org.objectweb.asm.MethodVisitor rv)
    If needed, emit bytecode at the top of the `run` method.
    Parameters:
      `gen` - the code generator
      `start` - a label at the top of the method
      `end` - a label at the end of the method
      `rv` - the visitor for the run method

  - ### generateLoadCode

    void generateLoadCode(JitCodeGenerator gen, JitType type, TypeConversions.Ext ext, org.objectweb.asm.MethodVisitor rv)
    Emit bytecode to load the varnode's value onto the JVM stack.
    Parameters:
      `gen` - the code generator
      `type` - the p-code type of the value expected on the JVM stack by the proceeding bytecode
      `ext` - the kind of extension to apply when adjusting from JVM size to varnode size
      `rv` - the visitor for the `run` method

  - ### generateStoreCode

    void generateStoreCode(JitCodeGenerator gen, JitType type, TypeConversions.Ext ext, org.objectweb.asm.MethodVisitor rv)
    Emit bytecode to load the varnode's value onto the JVM stack.
    Parameters:
      `gen` - the code generator
      `type` - the p-code type of the value produced on the JVM stack by the preceding bytecode
      `ext` - the kind of extension to apply when adjusting from varnode size to JVM size
      `rv` - the visitor for the `run` method