org.jikesrvm.adaptive.measurements.listeners
Class CallDensityListener

java.lang.Object
  extended by org.jikesrvm.adaptive.measurements.listeners.Listener
      extended by org.jikesrvm.adaptive.measurements.listeners.NullListener
          extended by org.jikesrvm.adaptive.measurements.listeners.CallDensityListener

public final class CallDensityListener
extends NullListener

A simple listener to accumulate counts of total events and the fraction of those events that occured at loop backedges. In effect, this provides a mechanism for estimating the call density of the program. If most yieldpoints are being taken at backedges, then call density is low.


Field Summary
private  double numBackedgeSamples
           
private  double numSamples
           
 
Constructor Summary
CallDensityListener()
           
 
Method Summary
 double callDensity()
           
 void report()
          Entry point to dump what has been collected.
 void reset()
          reset the listeners data structures
 void update(int whereFrom)
          This method is called when its time to record that a yield point has occurred.
 
Methods inherited from class org.jikesrvm.adaptive.measurements.listeners.Listener
activate, activateOrganizer, isActive, passivate, setOrganizer
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

numSamples

private double numSamples

numBackedgeSamples

private double numBackedgeSamples
Constructor Detail

CallDensityListener

public CallDensityListener()
Method Detail

update

public void update(int whereFrom)
This method is called when its time to record that a yield point has occurred.

Specified by:
update in class NullListener
Parameters:
whereFrom - Was this a yieldpoint in a PROLOGUE, BACKEDGE, or EPILOGUE?

callDensity

public double callDensity()

reset

public void reset()
Description copied from class: Listener
reset the listeners data structures

Specified by:
reset in class Listener

report

public void report()
Description copied from class: Listener
Entry point to dump what has been collected.

Specified by:
report in class Listener