|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.rice.cs.cunit.instrumentors.util.AInsertAtOpcodeStrategy
edu.rice.cs.cunit.instrumentors.delay.CallOnSynchronizedBlockStrategy
public class CallOnSynchronizedBlockStrategy
Instrumentation strategy that adds code before and after a monitorenter instruction.
Field Summary | |
---|---|
protected java.lang.String |
_className
Name of the class containing the method to be called. |
protected java.lang.String |
_methodName
Name of the method to be called. |
protected java.lang.String |
_postVarClassName
Name of the class containing the post-enabled flag. |
protected java.lang.String |
_postVarName
Name of the post-enabled flag. |
protected java.lang.String |
_preVarClassName
Name of the class containing the pre-enabled flag. |
protected java.lang.String |
_preVarName
Name of the pre-enabled flag. |
Fields inherited from class edu.rice.cs.cunit.instrumentors.util.AInsertAtOpcodeStrategy |
---|
_afterOpcodePredicate, _beforeOpcodePredicate, _classPredicate, _methodPredicate, OPCODE_NEVER |
Constructor Summary | |
---|---|
CallOnSynchronizedBlockStrategy(java.lang.String className,
java.lang.String methodName,
java.lang.String preVarClassName,
java.lang.String preVarName,
java.lang.String postVarClassName,
java.lang.String postVarName)
Create a new strategy. |
Method Summary | |
---|---|
boolean |
insertEndOfMethod(ClassFile cf,
MethodInfo mi,
InstructionList il,
boolean insertBefore,
boolean insertAfter)
Insert instructions at the end of the method. |
void |
insertInstructionsAfter(ClassFile cf,
MethodInfo mi,
InstructionList il)
Add instructions to call SyncPointBuffer.randomDelay after a monitorenter. |
void |
insertInstructionsBefore(ClassFile cf,
MethodInfo mi,
InstructionList il)
Add instructions to call SyncPointBuffer.randomDelay before a monitorenter. |
void |
modifyStackAndLocals(ClassFile cf,
MethodInfo mi,
InstructionList il,
boolean insertBefore,
boolean insertAfter,
boolean insertEndOfMethod)
Modify the stack size and number of local variables so that the added instructions can execute. |
Methods inherited from class edu.rice.cs.cunit.instrumentors.util.AInsertAtOpcodeStrategy |
---|
done, instrument |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected java.lang.String _className
protected java.lang.String _methodName
protected java.lang.String _preVarClassName
protected java.lang.String _preVarName
protected java.lang.String _postVarClassName
protected java.lang.String _postVarName
Constructor Detail |
---|
public CallOnSynchronizedBlockStrategy(java.lang.String className, java.lang.String methodName, java.lang.String preVarClassName, java.lang.String preVarName, java.lang.String postVarClassName, java.lang.String postVarName)
className
- name of the class containing the method to be calledmethodName
- name of the method to be calledpreVarClassName
- name of the class containing the pre-enabled flagpreVarName
- name of the pre-enabled flagpostVarClassName
- name of the class containing the post-enabled flagpostVarName
- name of the post-enabled flagMethod Detail |
---|
public void insertInstructionsBefore(ClassFile cf, MethodInfo mi, InstructionList il)
insertInstructionsBefore
in class AInsertAtOpcodeStrategy
cf
- class filemi
- method informationil
- instruction listpublic void insertInstructionsAfter(ClassFile cf, MethodInfo mi, InstructionList il)
insertInstructionsAfter
in class AInsertAtOpcodeStrategy
cf
- class filemi
- method informationil
- instruction listpublic boolean insertEndOfMethod(ClassFile cf, MethodInfo mi, InstructionList il, boolean insertBefore, boolean insertAfter)
insertEndOfMethod
in class AInsertAtOpcodeStrategy
cf
- class filemi
- method informationil
- instruction listinsertBefore
- true if code was inserted before an opcodeinsertAfter
- true if code was inserted after an opcode
public void modifyStackAndLocals(ClassFile cf, MethodInfo mi, InstructionList il, boolean insertBefore, boolean insertAfter, boolean insertEndOfMethod)
modifyStackAndLocals
in class AInsertAtOpcodeStrategy
cf
- class filemi
- method informationil
- instruction listinsertBefore
- true if code was inserted before an opcodeinsertAfter
- true if code was inserted after an opcodeinsertEndOfMethod
- true if code was inserted at the end of the method
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |