Class Advice.StackMapFrameHandler.Default

    • Field Detail

      • instrumentedMethod

        protected final MethodDescription instrumentedMethod
        The instrumented method.
      • enterTypes

        protected final TypeList enterTypes
        A list of virtual method arguments that are available before the instrumented method is executed.
      • exitTypes

        protected final TypeList exitTypes
        A list of virtual method arguments that are available after the instrumented method has completed.
    • Constructor Detail

      • Default

        protected Default​(TypeDescription instrumentedType,
                          MethodDescription instrumentedMethod,
                          TypeList enterTypes,
                          TypeList exitTypes,
                          boolean expandFrames)
        Creates a new default meta data handler.
        Parameters:
        instrumentedType - The instrumented type.
        instrumentedMethod - The instrumented method.
        enterTypes - A list of virtual method arguments that are available before the instrumented method is executed.
        exitTypes - A list of virtual method arguments that are available after the instrumented method has completed.
        expandFrames - true if the meta data handler is expected to expand its frames.
    • Method Detail

      • of

        protected static Advice.StackMapFrameHandler.ForInstrumentedMethod of​(TypeDescription instrumentedType,
                                                                              MethodDescription instrumentedMethod,
                                                                              java.util.List<? extends TypeDescription> enterTypes,
                                                                              java.util.List<? extends TypeDescription> exitTypes,
                                                                              ClassFileVersion classFileVersion,
                                                                              int writerFlags,
                                                                              int readerFlags)
        Creates an appropriate stack map frame handler for an instrumented method.
        Parameters:
        instrumentedType - The instrumented type.
        instrumentedMethod - The instrumented method.
        enterTypes - A list of virtual method arguments that are available before the instrumented method is executed.
        exitTypes - A list of virtual method arguments that are available after the instrumented method has completed.
        classFileVersion - The instrumented type's class file version.
        writerFlags - The flags supplied to the ASM writer.
        readerFlags - The reader flags supplied to the ASM reader.
        Returns:
        An appropriate stack map frame handler for an instrumented method.
      • toFrame

        protected static java.lang.Object toFrame​(TypeDescription typeDescription)
        Translates a type into a representation of its form inside a stack map frame.
        Parameters:
        typeDescription - The type to translate.
        Returns:
        A stack entry representation of the supplied type.
      • translateFrame

        public void translateFrame​(org.objectweb.asm.MethodVisitor methodVisitor,
                                   int type,
                                   int localVariableLength,
                                   java.lang.Object[] localVariable,
                                   int stackSize,
                                   java.lang.Object[] stack)
        Description copied from interface: Advice.StackMapFrameHandler
        Translates a frame.
        Specified by:
        translateFrame in interface Advice.StackMapFrameHandler
        Parameters:
        methodVisitor - The method visitor to write the frame to.
        type - The frame's type.
        localVariableLength - The local variable length.
        localVariable - An array containing the types of the current local variables.
        stackSize - The size of the operand stack.
        stack - An array containing the types of the current operand stack.
      • translateFrame

        protected void translateFrame​(org.objectweb.asm.MethodVisitor methodVisitor,
                                      Advice.StackMapFrameHandler.Default.TranslationMode translationMode,
                                      MethodDescription methodDescription,
                                      TypeList additionalTypes,
                                      int type,
                                      int localVariableLength,
                                      java.lang.Object[] localVariable,
                                      int stackSize,
                                      java.lang.Object[] stack)
        Translates a frame.
        Parameters:
        methodVisitor - The method visitor to write the frame to.
        translationMode - The translation mode to apply.
        methodDescription - The method description for which the frame is written.
        additionalTypes - The additional types to consider part of the instrumented method's parameters.
        type - The frame's type.
        localVariableLength - The local variable length.
        localVariable - An array containing the types of the current local variables.
        stackSize - The size of the operand stack.
        stack - An array containing the types of the current operand stack.
      • injectReturnFrame

        public void injectReturnFrame​(org.objectweb.asm.MethodVisitor methodVisitor)
        Description copied from interface: Advice.StackMapFrameHandler
        Injects a frame indicating the beginning of a return value handler for the currently handled method.
        Specified by:
        injectReturnFrame in interface Advice.StackMapFrameHandler
        Parameters:
        methodVisitor - The method visitor onto which to apply the stack map frame.
      • injectExceptionFrame

        public void injectExceptionFrame​(org.objectweb.asm.MethodVisitor methodVisitor)
        Description copied from interface: Advice.StackMapFrameHandler
        Injects a frame indicating the beginning of an exception handler for the currently handled method.
        Specified by:
        injectExceptionFrame in interface Advice.StackMapFrameHandler
        Parameters:
        methodVisitor - The method visitor onto which to apply the stack map frame.
      • injectCompletionFrame

        public void injectCompletionFrame​(org.objectweb.asm.MethodVisitor methodVisitor,
                                          boolean secondary)
        Description copied from interface: Advice.StackMapFrameHandler
        Injects a frame indicating the completion of the currently handled method, i.e. all yielded types were added.
        Specified by:
        injectCompletionFrame in interface Advice.StackMapFrameHandler
        Parameters:
        methodVisitor - The method visitor onto which to apply the stack map frame.
        secondary - true if another completion frame for this method was written previously.
      • injectFullFrame

        protected void injectFullFrame​(org.objectweb.asm.MethodVisitor methodVisitor,
                                       java.util.List<? extends TypeDescription> typesInArray,
                                       java.util.List<? extends TypeDescription> typesOnStack)
        Injects a full stack map frame.
        Parameters:
        methodVisitor - The method visitor onto which to write the stack map frame.
        typesInArray - The types that were added to the local variable array additionally to the values of the instrumented method.
        typesOnStack - The types currently on the operand stack.