org.jboss.byteman.agent.adapter
Class VariableAccessTriggerAdapter.VariableAccessTriggerMethodAdapter
java.lang.Object
MethodAdapter
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
Field Summary |
private int |
index
|
protected boolean |
latched
flag used by subclass to avoid inserting trigger until after super constructor has been called |
private int |
visitedCount
|
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 |
Method Summary |
private boolean |
matchCall(int opcode)
|
void |
visitIincInsn(int var,
int increment)
|
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. |
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. |
void |
visitVarInsn(int opcode,
int var)
override this so we can see track which local var slots are in use and avoid overwriting them |
Methods inherited from class org.jboss.byteman.agent.adapter.RuleTriggerMethodAdapter |
getInvokedTypes, getMethodName, getReturnBindingType, inBytemanHandler, inBytemanTrigger, injectTriggerPoint, inRethrowHandler, visitCode, visitEnd, visitFieldInsn, visitInsn, visitIntInsn, 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, 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, putField, putStatic, ret, returnValue, storeArg, storeLocal, swap, swap, tableSwitch, tableSwitch, throwException, throwException, unbox, visitFrame |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
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
VariableAccessTriggerAdapter.VariableAccessTriggerMethodAdapter
VariableAccessTriggerAdapter.VariableAccessTriggerMethodAdapter(MethodVisitor mv,
TransformContext transformContext,
int access,
java.lang.String name,
java.lang.String descriptor,
java.lang.String signature,
java.lang.String[] exceptions)
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
visitIincInsn
public void visitIincInsn(int var,
int increment)
- Overrides:
visitIincInsn
in class RuleTriggerMethodAdapter
matchCall
private boolean matchCall(int opcode)