Class RuleTriggerMethodAdapter


  • public class RuleTriggerMethodAdapter
    extends RuleGeneratorAdapter
    class which provides base functionality extended by all the location-specific method trigger adapters
    • Field Detail

      • exceptions

        protected String[] exceptions
    • Method Detail

      • getInvokedTypes

        public org.objectweb.asm.Type[] getInvokedTypes()
        method overridden by AT INVOKE method adapter allowing types for the invoked method owner, parameters and return value to be identified. this default version should never get invoked
        Returns:
        an array containing the types of the invoked method owner, parameters and return value
      • getReturnBindingType

        public org.objectweb.asm.Type getReturnBindingType()
        method overridden by AT INVOKE method adapter allowing the type of the $! binding to be identified. this default version should only get invoked for an AT EXIT rule where it returns the trigger method return type. the overridden version should only get invoked for an AFTER INVOKE rule where it returns the invoked method return type
        Returns:
        the appropriate return type
      • inBytemanHandler

        protected boolean inBytemanHandler()
        return true if the current block is a handler which catches a byteman exception thrown by the byteman runtime
        Returns:
        true if the current block is a handler false if not
      • inBytemanTrigger

        protected boolean inBytemanTrigger()
        return true if the current block is in a trigger block injected by Byteman
        Returns:
        true if the current block is in a trigger block false if not
      • inRethrowHandler

        protected boolean inRethrowHandler()
        return true if the current block is handler which catches a thrown exception within the scope of a monitor enter in order to be able exit the monitor and rethrow the exception
        Returns:
        true if the current block is in a rethrow handler false if not
      • getMethodName

        protected String getMethodName()
      • visitCode

        public void visitCode()
        Overrides:
        visitCode in class org.objectweb.asm.MethodVisitor
      • visitInsn

        public void visitInsn​(int opcode)
        Overrides:
        visitInsn in class org.objectweb.asm.MethodVisitor
      • visitIincInsn

        public void visitIincInsn​(int var,
                                  int increment)
        Overrides:
        visitIincInsn in class org.objectweb.asm.MethodVisitor
      • visitIntInsn

        public void visitIntInsn​(int opcode,
                                 int operand)
        Overrides:
        visitIntInsn in class org.objectweb.asm.MethodVisitor
      • visitLdcInsn

        public void visitLdcInsn​(Object cst)
        Overrides:
        visitLdcInsn in class org.objectweb.asm.MethodVisitor
      • visitVarInsn

        public void visitVarInsn​(int opcode,
                                 int var)
        Description copied from class: RuleGeneratorAdapter
        override this so we can see track which local var slots are in use and avoid overwriting them
        Overrides:
        visitVarInsn in class RuleGeneratorAdapter
        Parameters:
        opcode - the bytecode operation
        var - local variable index
      • visitTypeInsn

        public void visitTypeInsn​(int opcode,
                                  String desc)
        Overrides:
        visitTypeInsn in class org.objectweb.asm.MethodVisitor
      • visitFieldInsn

        public void visitFieldInsn​(int opcode,
                                   String owner,
                                   String name,
                                   String desc)
        Overrides:
        visitFieldInsn in class org.objectweb.asm.MethodVisitor
      • visitMethodInsn

        public void visitMethodInsn​(int opcode,
                                    String owner,
                                    String name,
                                    String desc,
                                    boolean itf)
        Overrides:
        visitMethodInsn in class org.objectweb.asm.MethodVisitor
      • visitInvokeDynamicInsn

        public void visitInvokeDynamicInsn​(String name,
                                           String desc,
                                           org.objectweb.asm.Handle bsm,
                                           Object... bsmArgs)
        Overrides:
        visitInvokeDynamicInsn in class org.objectweb.asm.MethodVisitor
      • visitJumpInsn

        public void visitJumpInsn​(int opcode,
                                  org.objectweb.asm.Label label)
        Overrides:
        visitJumpInsn in class org.objectweb.asm.MethodVisitor
      • visitLabel

        public void visitLabel​(org.objectweb.asm.Label label)
        Overrides:
        visitLabel in class org.objectweb.asm.MethodVisitor
      • visitTriggerStart

        public void visitTriggerStart​(org.objectweb.asm.Label label)
      • visitTriggerEnd

        public void visitTriggerEnd​(org.objectweb.asm.Label label)
      • visitTableSwitchInsn

        public void visitTableSwitchInsn​(int min,
                                         int max,
                                         org.objectweb.asm.Label dflt,
                                         org.objectweb.asm.Label[] labels)
        Overrides:
        visitTableSwitchInsn in class org.objectweb.asm.MethodVisitor
      • visitLookupSwitchInsn

        public void visitLookupSwitchInsn​(org.objectweb.asm.Label dflt,
                                          int[] keys,
                                          org.objectweb.asm.Label[] labels)
        Overrides:
        visitLookupSwitchInsn in class org.objectweb.asm.MethodVisitor
      • visitMultiANewArrayInsn

        public void visitMultiANewArrayInsn​(String desc,
                                            int dims)
        Overrides:
        visitMultiANewArrayInsn in class org.objectweb.asm.MethodVisitor
      • visitTryCatchBlock

        public void visitTryCatchBlock​(org.objectweb.asm.Label start,
                                       org.objectweb.asm.Label end,
                                       org.objectweb.asm.Label handler,
                                       String type)
        Overrides:
        visitTryCatchBlock in class org.objectweb.asm.MethodVisitor
      • visitMaxs

        public void visitMaxs​(int maxStack,
                              int maxLocals)
        Description copied from class: RuleGeneratorAdapter
        ensure we allow enough room for any extra locals on the stack
        Overrides:
        visitMaxs in class RuleGeneratorAdapter
        Parameters:
        maxStack - the maximum stack depth
        maxLocals - the maximum local count
      • visitEnd

        public void visitEnd()
        Overrides:
        visitEnd in class org.objectweb.asm.MethodVisitor
      • injectTriggerPoint

        protected void injectTriggerPoint()
        inject the rule trigger code