Enum Implementation.Context.FrameGeneration

    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
      DISABLED
      Indicates that no frames should be generated.
      EXPAND
      Indicates that frames should be generated and expanded.
      GENERATE
      Indicates that frames should be generated.
    • Field Summary

      Fields 
      Modifier and Type Field Description
      private boolean active
      true if frames should be generated.
      private static java.lang.Object[] EMPTY
      An empty array to reuse for empty frames.
    • Constructor Summary

      Constructors 
      Modifier Constructor Description
      private FrameGeneration​(boolean active)
      Creates a new frame generation type.
    • Method Summary

      All Methods Static Methods Instance Methods Abstract Methods Concrete Methods 
      Modifier and Type Method Description
      void append​(org.objectweb.asm.MethodVisitor methodVisitor, java.util.List<? extends TypeDefinition> appended, java.util.List<? extends TypeDefinition> localVariables)
      Inserts a Opcodes.F_APPEND frame.
      void chop​(org.objectweb.asm.MethodVisitor methodVisitor, int chopped, java.util.List<? extends TypeDefinition> localVariables)
      Inserts a Opcodes.F_CHOP frame.
      void full​(org.objectweb.asm.MethodVisitor methodVisitor, java.util.List<? extends TypeDefinition> stackValues, java.util.List<? extends TypeDefinition> localVariables)
      Inserts a Opcodes.F_FULL frame.
      protected abstract void generate​(org.objectweb.asm.MethodVisitor methodVisitor, int type, int stackCount, java.lang.Object[] stack, int changedLocalVariableCount, java.lang.Object[] changedLocalVariable, int fullLocalVariableCount, java.lang.Object[] fullLocalVariable)
      Writes frames to a MethodVisitor, if applicable.
      boolean isActive()
      Returns true if frames should be generated.
      void same​(org.objectweb.asm.MethodVisitor methodVisitor, java.util.List<? extends TypeDefinition> localVariables)
      Inserts a Opcodes.F_SAME frame.
      void same1​(org.objectweb.asm.MethodVisitor methodVisitor, TypeDefinition stackValue, java.util.List<? extends TypeDefinition> localVariables)
      Inserts a Opcodes.F_SAME1 frame.
      private static java.lang.Object toStackMapFrame​(TypeDefinition typeDefinition)  
      private static java.lang.Object[] toStackMapFrames​(java.util.List<? extends TypeDefinition> typeDefinitions)  
      static Implementation.Context.FrameGeneration valueOf​(java.lang.String name)
      Returns the enum constant of this type with the specified name.
      static Implementation.Context.FrameGeneration[] values()
      Returns an array containing the constants of this enum type, in the order they are declared.
      • Methods inherited from class java.lang.Enum

        clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf
      • Methods inherited from class java.lang.Object

        getClass, notify, notifyAll, wait, wait, wait
    • Field Detail

      • EMPTY

        private static final java.lang.Object[] EMPTY
        An empty array to reuse for empty frames.
      • active

        private final boolean active
        true if frames should be generated.
    • Constructor Detail

      • FrameGeneration

        private FrameGeneration​(boolean active)
        Creates a new frame generation type.
        Parameters:
        active - true if frames should be generated.
    • Method Detail

      • values

        public static Implementation.Context.FrameGeneration[] values()
        Returns an array containing the constants of this enum type, in the order they are declared. This method may be used to iterate over the constants as follows:
        for (Implementation.Context.FrameGeneration c : Implementation.Context.FrameGeneration.values())
            System.out.println(c);
        
        Returns:
        an array containing the constants of this enum type, in the order they are declared
      • valueOf

        public static Implementation.Context.FrameGeneration valueOf​(java.lang.String name)
        Returns the enum constant of this type with the specified name. The string must match exactly an identifier used to declare an enum constant in this type. (Extraneous whitespace characters are not permitted.)
        Parameters:
        name - the name of the enum constant to be returned.
        Returns:
        the enum constant with the specified name
        Throws:
        java.lang.IllegalArgumentException - if this enum type has no constant with the specified name
        java.lang.NullPointerException - if the argument is null
      • isActive

        public boolean isActive()
        Returns true if frames should be generated.
        Returns:
        true if frames should be generated.
      • same

        public void same​(org.objectweb.asm.MethodVisitor methodVisitor,
                         java.util.List<? extends TypeDefinition> localVariables)
        Inserts a Opcodes.F_SAME frame.
        Parameters:
        methodVisitor - The method visitor to write to.
        localVariables - The local variables that are defined at this frame location.
      • same1

        public void same1​(org.objectweb.asm.MethodVisitor methodVisitor,
                          TypeDefinition stackValue,
                          java.util.List<? extends TypeDefinition> localVariables)
        Inserts a Opcodes.F_SAME1 frame.
        Parameters:
        methodVisitor - The method visitor to write to.
        stackValue - The single stack value.
        localVariables - The local variables that are defined at this frame location.
      • append

        public void append​(org.objectweb.asm.MethodVisitor methodVisitor,
                           java.util.List<? extends TypeDefinition> appended,
                           java.util.List<? extends TypeDefinition> localVariables)
        Inserts a Opcodes.F_APPEND frame.
        Parameters:
        methodVisitor - The method visitor to write to.
        appended - The appended local variables.
        localVariables - The local variables that are defined at this frame location, excluding the ones appended.
      • chop

        public void chop​(org.objectweb.asm.MethodVisitor methodVisitor,
                         int chopped,
                         java.util.List<? extends TypeDefinition> localVariables)
        Inserts a Opcodes.F_CHOP frame.
        Parameters:
        methodVisitor - The method visitor to write to.
        chopped - The number of chopped values.
        localVariables - The local variables that are defined at this frame location, excluding the chopped variables.
      • full

        public void full​(org.objectweb.asm.MethodVisitor methodVisitor,
                         java.util.List<? extends TypeDefinition> stackValues,
                         java.util.List<? extends TypeDefinition> localVariables)
        Inserts a Opcodes.F_FULL frame.
        Parameters:
        methodVisitor - The method visitor to write to.
        stackValues - The values on the operand stack.
        localVariables - The local variables that are defined at this frame location.
      • generate

        protected abstract void generate​(org.objectweb.asm.MethodVisitor methodVisitor,
                                         int type,
                                         int stackCount,
                                         @MaybeNull
                                         java.lang.Object[] stack,
                                         int changedLocalVariableCount,
                                         @MaybeNull
                                         java.lang.Object[] changedLocalVariable,
                                         int fullLocalVariableCount,
                                         @MaybeNull
                                         java.lang.Object[] fullLocalVariable)
        Writes frames to a MethodVisitor, if applicable.
        Parameters:
        methodVisitor - The method visitor to use
        type - The frame type.
        stackCount - The number of values on the operand stack.
        stack - The values on the operand stack up to stackCount, or null, if none.
        changedLocalVariableCount - The number of local variables that were changed.
        changedLocalVariable - The values added to the local variable array up to changedLocalVariableCount or null, if none or not applicable.
        fullLocalVariableCount - The number of local variables.
        fullLocalVariable - The total number of local variables up to fullLocalVariableCount or null, if none.
      • toStackMapFrames

        private static java.lang.Object[] toStackMapFrames​(java.util.List<? extends TypeDefinition> typeDefinitions)
      • toStackMapFrame

        private static java.lang.Object toStackMapFrame​(TypeDefinition typeDefinition)