harpoon.Analysis.Quads
Class FieldSyncOracle

java.lang.Object
  extended by harpoon.Analysis.Quads.FieldSyncOracle

public class FieldSyncOracle
extends Object

A FieldSyncOracle tells which fields a given method could possibly access (either directly, or via a method call), and whether the given method will ever acquire/release a lock (either directly, or via a method call). This analysis is useful for determining which memory optimizations are safe across a given method call (and other things).

Version:
$Id: FieldSyncOracle.java,v 1.4 2004/02/08 03:20:10 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>

Constructor Summary
FieldSyncOracle(HCodeFactory hcf, ClassHierarchy ch, CallGraph cg)
          Creates a FieldSyncOracle.
 
Method Summary
 Set fieldsRead(HMethod hm)
          Returns a Set of HFields read, either directly or indirectly, by HMethod hm.
 Set fieldsWritten(HMethod hm)
          Returns a Set of HFields written, either directly or indirectly, by HMethod hm.
 boolean isRead(HMethod hm, HField hf)
          Returns true if HMethod hm will ever read HField hf, either directly or via a method call.
 boolean isSync(HMethod hm)
          Returns true if HMethod hm will ever acquire/release a lock (either directly, or via a method call).
 boolean isWritten(HMethod hm, HField hf)
          Returns true if HMethod hm will ever write HField hf, either directly or via a method call.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FieldSyncOracle

public FieldSyncOracle(HCodeFactory hcf,
                       ClassHierarchy ch,
                       CallGraph cg)
Creates a FieldSyncOracle.

Method Detail

isSync

public boolean isSync(HMethod hm)
Returns true if HMethod hm will ever acquire/release a lock (either directly, or via a method call).


isRead

public boolean isRead(HMethod hm,
                      HField hf)
Returns true if HMethod hm will ever read HField hf, either directly or via a method call.


fieldsRead

public Set fieldsRead(HMethod hm)
Returns a Set of HFields read, either directly or indirectly, by HMethod hm.


isWritten

public boolean isWritten(HMethod hm,
                         HField hf)
Returns true if HMethod hm will ever write HField hf, either directly or via a method call.


fieldsWritten

public Set fieldsWritten(HMethod hm)
Returns a Set of HFields written, either directly or indirectly, by HMethod hm.