Class LocalsStateGenerators


  • final class LocalsStateGenerators
    extends java.lang.Object
    Utility class to generate bytecode instructions that save/load the local variables table.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      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.
      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.
      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.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • LocalsStateGenerators

        private LocalsStateGenerators()
    • Method Detail

      • 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:
        java.lang.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:
        java.lang.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:
        java.lang.NullPointerException - if any argument is null