Class VariableAccessTriggerAdapter.VariableAccessTriggerMethodAdapter

    • Field Detail

      • latched

        protected boolean latched
        flag used by subclass to avoid inserting trigger until after super constructor has been called
      • index

        private int index
      • visitedCount

        private int visitedCount
    • Constructor Detail

      • VariableAccessTriggerMethodAdapter

        VariableAccessTriggerMethodAdapter​(org.objectweb.asm.MethodVisitor mv,
                                           TransformContext transformContext,
                                           int access,
                                           java.lang.String name,
                                           java.lang.String descriptor,
                                           java.lang.String signature,
                                           java.lang.String[] exceptions)
    • Method Detail

      • visitLocalScopeStart

        public void visitLocalScopeStart​(java.lang.String name,
                                         java.lang.String desc,
                                         java.lang.String signature,
                                         int stackSlot,
                                         int startOffset)
        checks if the local var coming into scope is the one mentioned in the rule location and if so records which slot is now being used to store the variable. this is called by the BMJSRInliner which feeds this adapter because this adapter implements LocalScopeMethodVisitor
        Specified by:
        visitLocalScopeStart in interface LocalScopeMethodVisitor
        Parameters:
        name -
        desc -
        signature -
        stackSlot -
      • visitLocalScopeEnd

        public void visitLocalScopeEnd​(java.lang.String name,
                                       java.lang.String desc,
                                       java.lang.String signature,
                                       int stackSlot,
                                       int endOffset)
        checks if the local var going out of scope is the one mentioned in the rule location and if so records that the slot is no longer active. this is called by the BMJSRInliner which feeds this adapter because this adapter implements LocalScopeMethodVisitor
        Specified by:
        visitLocalScopeEnd in interface LocalScopeMethodVisitor
        Parameters:
        name -
        desc -
        signature -
        stackSlot -
      • 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 RuleTriggerMethodAdapter
        Parameters:
        opcode - the bytecode operation
        var - local variable index
      • matchCall

        private boolean matchCall​(int opcode)