harpoon.Runtime
Class Counters

java.lang.Object
  extended by harpoon.Runtime.Counters

public class Counters
extends Object

Counters uses reflection to provide a very light-weight counter package -- light-weight in terms of FLEX code required to add/enable counters, not necessarily light-weight in terms of execution time. All counters are thread-safe. We use reflection at initialization time and at program termination to initialize and report counter values, which minimizes the amount of counter-specific code generation required by the FLEX side of this. No special runtime support is required.

The dynamic generation of counter fields in this class is handled by harpoon.Analysis.Counters.CounterFactory. There is a HCodeFactory in this class which must be included as a compilation pass to generate the proper calls to the report() method at program's end.

Version:
$Id: Counters.java,v 1.2 2002/02/25 21:06:26 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>

Method Summary
static void report()
          Report counter values to System.err, using reflection to discover all fields starting with "COUNTER_".
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

report

public static void report()
Report counter values to System.err, using reflection to discover all fields starting with "COUNTER_".