Class VariableAccessTriggerAdapter.VariableAccessTriggerMethodAdapter

java.lang.Object
org.objectweb.asm.MethodVisitor
All Implemented Interfaces:
LocalScopeMethodVisitor
Direct Known Subclasses:
VariableAccessTriggerAdapter.VariableAccessTriggerConstructorAdapter
Enclosing class:
VariableAccessTriggerAdapter

private class VariableAccessTriggerAdapter.VariableAccessTriggerMethodAdapter extends RuleTriggerMethodAdapter implements LocalScopeMethodVisitor
a method visitor used to add a rule event trigger call to a method
  • Field Details

    • 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 Details

    • VariableAccessTriggerMethodAdapter

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

    • visitLocalScopeStart

      public void visitLocalScopeStart(String name, String desc, 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(String name, String desc, 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
    • visitIincInsn

      public void visitIincInsn(int var, int increment)
      Overrides:
      visitIincInsn in class RuleTriggerMethodAdapter
    • matchCall

      private boolean matchCall(int opcode)