org.jikesrvm.compilers.opt
Class InstrumentedEventCounterManager

java.lang.Object
  extended by org.jikesrvm.compilers.opt.InstrumentedEventCounterManager
Direct Known Subclasses:
CounterArrayManager

public abstract class InstrumentedEventCounterManager
extends Object

This interface defines the functionality necessary to be a InstrumentedEventCounterManager. The goal of this interface is to provide a mechanism for instrumentation phases to performing counting of events, but to keep the implementation of the counters completely hidden.


Field Summary
(package private) static boolean DEBUG
           
 
Constructor Summary
InstrumentedEventCounterManager()
           
 
Method Summary
abstract  Instruction createEventCounterInstruction(int handle, int location, double incrementValue)
          Create a place holder instruction to represent the counted event.
abstract  double getCounter(int handle, int location)
          Get the value of a counter.
abstract  void insertBaselineCounter()
          Allow a counter to be inserted into a baseline compiled method.
abstract  void mutateOptEventCounterInstruction(Instruction i, IR ir)
          Take an event counter instruction and mutate it into IR instructions that will do the actual counting.
abstract  int registerCounterSpace(int countersNeeded)
          This method is called to called to tell the counter manager to reserve the needed space.
abstract  void resizeCounterSpace(int handle, int countersNeeded)
          This method is called to change the number of counters needed.
abstract  void setCounter(int handle, int location, double value)
          Set the value of a counter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEBUG

static final boolean DEBUG
See Also:
Constant Field Values
Constructor Detail

InstrumentedEventCounterManager

public InstrumentedEventCounterManager()
Method Detail

registerCounterSpace

public abstract int registerCounterSpace(int countersNeeded)
This method is called to called to tell the counter manager to reserve the needed space. A handle is returned telling where the counter space begins.

Parameters:
countersNeeded - The number of counters being requested
Returns:
A "handle", or name for the counter space reserved.

resizeCounterSpace

public abstract void resizeCounterSpace(int handle,
                                        int countersNeeded)
This method is called to change the number of counters needed.

Parameters:
handle - The handle describing which the data to be resized
countersNeeded - The number of counters needed

getCounter

public abstract double getCounter(int handle,
                                  int location)
Get the value of a counter.

Parameters:
handle - The counter space to look in
location - The counter whose value to return

setCounter

public abstract void setCounter(int handle,
                                int location,
                                double value)
Set the value of a counter.

Parameters:
handle - The counter space to look in
location - The counter whose value to return
value - The new value of the counter

createEventCounterInstruction

public abstract Instruction createEventCounterInstruction(int handle,
                                                          int location,
                                                          double incrementValue)
Create a place holder instruction to represent the counted event.

Parameters:
handle - The counter space to look in
location - The counter whose value to return
incrementValue - The value to add to the counter
Returns:
The instruction to increment the given counter

mutateOptEventCounterInstruction

public abstract void mutateOptEventCounterInstruction(Instruction i,
                                                      IR ir)
Take an event counter instruction and mutate it into IR instructions that will do the actual counting.


insertBaselineCounter

public abstract void insertBaselineCounter()
Allow a counter to be inserted into a baseline compiled method. Still under construction.