edu.rice.cs.cunit.instrumentors
Class MarkerInlineStrategy

java.lang.Object
  extended by edu.rice.cs.cunit.instrumentors.MarkerInlineStrategy
All Implemented Interfaces:
IInstrumentationStrategy

public class MarkerInlineStrategy
extends java.lang.Object
implements IInstrumentationStrategy

Instrumentation strategy to replace static calls to certain marker methods with inlined bytecode. 1) "invokestatic SyncPointBuffer.monitorEnter" -> "monitorenter". 2) "invokestatic SyncPointBuffer.monitorExit" -> "monitorexit". 3) "invokestatic SyncPointBuffer.isOldThread" -> "invokestatic java/lang/Thread.currentThread; getfield java/lang/Thread.$$$oldThread$$$" 4) "invokestatic SyncPointBuffer.setOldThread" -> "iconst_1; invokestatic java/lang/Thread.currentThread; putfield java/lang/Thread.$$$oldThread$$$"

Author:
Mathias Ricken

Field Summary
private  boolean _addNames
          True if names still have to be added.
private  ReferenceInstruction _getOldThreadFieldInstr
          getfield java/lang/Thread.$$$oldThread$$$ instruction.
private  GenericInstruction _iconst_1
          iconst_1 instruction.
private  ReferenceInstruction _invokeCurrentThreadInstr
          invokestatic java/lang/Thread.currentThread()Ljava/lang/Thread; instruction
private  GenericInstruction _monitorEnter
          monitorenter instruction.
private  GenericInstruction _monitorExit
          monitorexit instruction.
private  ReferenceInstruction _putOldThreadFieldInstr
          putfield java/lang/Thread.$$$oldThread$$$ instruction.
 
Constructor Summary
MarkerInlineStrategy()
           
 
Method Summary
private  void addNamesIfNecessary(ClassFile cf)
          Add names to the constant pool if necessary.
 void done()
          Instrumentation of all classes is done.
 void instrument(ClassFile cf)
          Instrument the class.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_monitorEnter

private final GenericInstruction _monitorEnter
monitorenter instruction.


_monitorExit

private final GenericInstruction _monitorExit
monitorexit instruction.


_iconst_1

private final GenericInstruction _iconst_1
iconst_1 instruction.


_getOldThreadFieldInstr

private final ReferenceInstruction _getOldThreadFieldInstr
getfield java/lang/Thread.$$$oldThread$$$ instruction.


_putOldThreadFieldInstr

private final ReferenceInstruction _putOldThreadFieldInstr
putfield java/lang/Thread.$$$oldThread$$$ instruction.


_invokeCurrentThreadInstr

private final ReferenceInstruction _invokeCurrentThreadInstr
invokestatic java/lang/Thread.currentThread()Ljava/lang/Thread; instruction


_addNames

private boolean _addNames
True if names still have to be added.

Constructor Detail

MarkerInlineStrategy

public MarkerInlineStrategy()
Method Detail

instrument

public void instrument(ClassFile cf)
Instrument the class.

Specified by:
instrument in interface IInstrumentationStrategy
Parameters:
cf - class file info

addNamesIfNecessary

private void addNamesIfNecessary(ClassFile cf)
Add names to the constant pool if necessary.

Parameters:
cf - class file

done

public void done()
Instrumentation of all classes is done.

Specified by:
done in interface IInstrumentationStrategy