harpoon.Analysis
Class ReachingDefsCachingImpl<HCE extends HCodeElement>

java.lang.Object
  extended by harpoon.Analysis.ReachingDefs<HCE>
      extended by harpoon.Analysis.ReachingDefsAltImpl<HCE>
          extended by harpoon.Analysis.ReachingDefsCachingImpl<HCE>

public class ReachingDefsCachingImpl<HCE extends HCodeElement>
extends ReachingDefsAltImpl<HCE>

ReachingDefsCachingImpl is an extension of ReachingDefsImpl that keeps a BasicBlock local cache mapping Temp:t -> HCodeElement:h -> Set:s where s is the result of calling reachingDefs(h, t). This way repeated queries in the same BasicBlock as the last query don't have to iterate over all the statements in the BasicBlock again.

Version:
$Id: ReachingDefsCachingImpl.java,v 1.5 2004/02/08 03:19:12 cananian Exp $
Author:
Felix S. Klock II <pnkfelix@mit.edu>

Field Summary
 
Fields inherited from class harpoon.Analysis.ReachingDefsAltImpl
bbf, bsf, cache, check_typecast, tempToAllDefs, ud
 
Fields inherited from class harpoon.Analysis.ReachingDefs
hc, TIME
 
Constructor Summary
ReachingDefsCachingImpl(HCode<HCE> hc)
          Creates a ReachingDefsCachingImpl.
ReachingDefsCachingImpl(HCode<HCE> hc, CFGrapher<HCE> c)
          Creates a ReachingDefsCachingImpl.
ReachingDefsCachingImpl(HCode<HCE> hc, CFGrapher<HCE> c, UseDefer<HCE> ud)
          Creates a ReachingDefsCachingImpl.
 
Method Summary
 Set<HCE> reachingDefs(HCE hce, Temp t)
          Returns the Set of HCodeElements providing definitions of Temp t which reach HCodeElement hce.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ReachingDefsCachingImpl

public ReachingDefsCachingImpl(HCode<HCE> hc)
Creates a ReachingDefsCachingImpl.


ReachingDefsCachingImpl

public ReachingDefsCachingImpl(HCode<HCE> hc,
                               CFGrapher<HCE> c)
Creates a ReachingDefsCachingImpl.


ReachingDefsCachingImpl

public ReachingDefsCachingImpl(HCode<HCE> hc,
                               CFGrapher<HCE> c,
                               UseDefer<HCE> ud)
Creates a ReachingDefsCachingImpl.

Method Detail

reachingDefs

public Set<HCE> reachingDefs(HCE hce,
                             Temp t)
Returns the Set of HCodeElements providing definitions of Temp t which reach HCodeElement hce.

Overrides:
reachingDefs in class ReachingDefsAltImpl<HCE extends HCodeElement>