Class LocalsStateGenerators

java.lang.Object
com.offbynull.coroutines.instrumenter.LocalsStateGenerators

final class LocalsStateGenerators extends Object
Utility class to generate bytecode instructions that save/load the local variables table.
  • Constructor Details

    • LocalsStateGenerators

      private LocalsStateGenerators()
  • Method Details

    • loadLocals

      public static org.objectweb.asm.tree.InsnList loadLocals(DebugGenerators.MarkerType markerType, StorageVariables storageVars, org.objectweb.asm.tree.analysis.Frame<org.objectweb.asm.tree.analysis.BasicValue> frame)
      Generates instructions to load the local variables table.
      Parameters:
      markerType - debug marker type
      storageVars - variables to load locals from
      frame - execution frame at the instruction for which the local variables table is to be restored
      Returns:
      instructions to load the local variables table from an array
      Throws:
      NullPointerException - if any argument is null
    • saveLocals

      public static org.objectweb.asm.tree.InsnList saveLocals(DebugGenerators.MarkerType markerType, StorageVariables storageVars, org.objectweb.asm.tree.analysis.Frame<org.objectweb.asm.tree.analysis.BasicValue> frame)
      Generates instructions to save the local variables table.
      Parameters:
      markerType - debug marker type
      storageVars - variables to store locals in to
      frame - execution frame at the instruction where the local variables table is to be saved
      Returns:
      instructions to save the local variables table in to an array
      Throws:
      NullPointerException - if any argument is null
    • computeSizes

      public static StorageSizes computeSizes(org.objectweb.asm.tree.analysis.Frame<org.objectweb.asm.tree.analysis.BasicValue> frame)
      Compute sizes required for the storage arrays that will contain the local variables table at this frame.
      Parameters:
      frame - frame to compute for
      Returns:
      size required by each storage array
      Throws:
      NullPointerException - if any argument is null