Package org.jboss.byteman.agent.adapter
Class VariableAccessTriggerAdapter.VariableAccessTriggerMethodAdapter
java.lang.Object
org.objectweb.asm.MethodVisitor
org.jboss.byteman.agent.adapter.RuleMethodAdapter
org.jboss.byteman.agent.adapter.RuleGeneratorAdapter
org.jboss.byteman.agent.adapter.RuleTriggerMethodAdapter
org.jboss.byteman.agent.adapter.VariableAccessTriggerAdapter.VariableAccessTriggerMethodAdapter
- 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
-
Nested Class Summary
Nested classes/interfaces inherited from class org.jboss.byteman.agent.adapter.RuleMethodAdapter
RuleMethodAdapter.LocalVar
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int
protected boolean
flag used by subclass to avoid inserting trigger until after super constructor has been calledprivate int
Fields inherited from class org.jboss.byteman.agent.adapter.RuleTriggerMethodAdapter
exceptions
Fields inherited from class org.jboss.byteman.agent.adapter.RuleGeneratorAdapter
ADD, AND, DIV, EQ, GE, GT, LE, LT, MUL, NE, NEG, OR, REM, SHL, SHR, SUB, USHR, XOR
Fields inherited from class org.jboss.byteman.agent.adapter.RuleMethodAdapter
access, descriptor, localVarsByName, name, rule, transformContext
Fields inherited from class org.objectweb.asm.MethodVisitor
api, mv
-
Constructor Summary
ConstructorsConstructorDescriptionVariableAccessTriggerMethodAdapter
(org.objectweb.asm.MethodVisitor mv, TransformContext transformContext, int access, String name, String descriptor, String signature, String[] exceptions) -
Method Summary
Modifier and TypeMethodDescriptionprivate boolean
matchCall
(int opcode) void
visitIincInsn
(int var, int increment) 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.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.void
visitVarInsn
(int opcode, int var) override this so we can see track which local var slots are in use and avoid overwriting themMethods inherited from class org.jboss.byteman.agent.adapter.RuleTriggerMethodAdapter
getInvokedTypes, getMethodName, getNewClassName, getReturnBindingType, inBytemanHandler, inBytemanTrigger, injectTriggerPoint, inRethrowHandler, visitCode, visitEnd, visitFieldInsn, visitInsn, visitIntInsn, visitInvokeDynamicInsn, visitJumpInsn, visitLabel, visitLdcInsn, visitLookupSwitchInsn, visitMaxs, visitMethodInsn, visitMultiANewArrayInsn, visitTableSwitchInsn, visitTriggerEnd, visitTriggerStart, visitTryCatchBlock, visitTypeInsn
Methods inherited from class org.jboss.byteman.agent.adapter.RuleGeneratorAdapter
arrayLength, arrayLoad, arrayStore, box, cast, catchException, checkCast, dup, dup2, dup2X1, dup2X2, dupX1, dupX2, endMethod, getField, getLocalType, getStatic, goTo, ifCmp, ifICmp, ifNonNull, ifNull, ifZCmp, iinc, instanceOf, invokeConstructor, invokeDynamic, invokeInterface, invokeStatic, invokeVirtual, loadArg, loadArgArray, loadArgs, loadArgs, loadLocal, loadThis, mark, mark, math, monitorEnter, monitorExit, newArray, newInstance, newLabel, newLocal, not, pop, pop2, popLocal, push, push, push, push, push, push, push, push, putField, putStatic, ret, returnValue, storeArg, storeLocal, swap, swap, tableSwitch, tableSwitch, throwException, throwException, unbox, visitFrame
Methods inherited from class org.jboss.byteman.agent.adapter.RuleMethodAdapter
getTriggerClassName, lookup, visitLocalVariable
Methods inherited from class org.objectweb.asm.MethodVisitor
getDelegate, visitAnnotableParameterCount, visitAnnotation, visitAnnotationDefault, visitAttribute, visitInsnAnnotation, visitLineNumber, visitLocalVariableAnnotation, visitMethodInsn, visitParameter, visitParameterAnnotation, visitTryCatchAnnotation, visitTypeAnnotation
-
Field Details
-
latched
protected boolean latchedflag 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 interfaceLocalScopeMethodVisitor
- 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 interfaceLocalScopeMethodVisitor
- 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 classRuleTriggerMethodAdapter
- Parameters:
opcode
- the bytecode operationvar
- local variable index
-
visitIincInsn
public void visitIincInsn(int var, int increment) - Overrides:
visitIincInsn
in classRuleTriggerMethodAdapter
-
matchCall
private boolean matchCall(int opcode)
-