edu.rice.cs.cunit.instrumentors.record
Class CompactRecordThreadExitStrategy

java.lang.Object
  extended by edu.rice.cs.cunit.instrumentors.util.AInsertAtOpcodeStrategy
      extended by edu.rice.cs.cunit.instrumentors.record.CompactRecordBufferCodeStrategy
          extended by edu.rice.cs.cunit.instrumentors.record.CompactRecordThreadExitStrategy
All Implemented Interfaces:
IInstrumentationStrategy

public class CompactRecordThreadExitStrategy
extends CompactRecordBufferCodeStrategy

Instrumentation strategy that adds code to java.lang.Thread.exit to call SyncPointBuffer.compactAdd.

Author:
Mathias Ricken

Field Summary
 
Fields inherited from class edu.rice.cs.cunit.instrumentors.record.CompactRecordBufferCodeStrategy
_code
 
Fields inherited from class edu.rice.cs.cunit.instrumentors.util.AInsertAtOpcodeStrategy
_afterOpcodePredicate, _beforeOpcodePredicate, _classPredicate, _methodPredicate, OPCODE_NEVER
 
Constructor Summary
CompactRecordThreadExitStrategy()
          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.
 
Methods inherited from class edu.rice.cs.cunit.instrumentors.record.CompactRecordBufferCodeStrategy
insertInstructionsAfter, insertInstructionsBefore, modifyStackAndLocals
 
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
 

Constructor Detail

CompactRecordThreadExitStrategy

public CompactRecordThreadExitStrategy()
Create a new strategy.

Method Detail

insertEndOfMethod

public boolean insertEndOfMethod(ClassFile cf,
                                 MethodInfo mi,
                                 InstructionList il,
                                 boolean insertBefore,
                                 boolean insertAfter)
Insert instructions at the end of the method. NOTE: The method is expected to move exactly to the last instruction that was inserted. If it moves to a place before the instruction, an infinite loop may occur. If it moves to a place after the instruction, future inserts may not occur.

Overrides:
insertEndOfMethod in class CompactRecordBufferCodeStrategy
Parameters:
cf - class file
mi - method information
il - instruction list
insertBefore - true if code was inserted before an opcode
insertAfter - true if code was inserted after an opcode
Returns:
true if code was inserted