harpoon.Analysis.PreciseGC
Class MRAFactory

java.lang.Object
  extended by harpoon.Analysis.PreciseGC.MRAFactory

public class MRAFactory
extends Object

MRAFactory generates MRAs.

Version:
$Id: MRAFactory.java,v 1.9 2004/02/08 03:20:07 cananian Exp $
Author:
Karen Zee <kkz@tmi.lcs.mit.edu>

Constructor Summary
MRAFactory(ClassHierarchy ch, HCodeFactory hcf, Linker l, String rName, int optLevel)
          Creates an MRAFactory.
 
Method Summary
 boolean allocatedTypesKnown(HMethod hm)
          Checks whether the types that the HMethod may allocate are known.
 void clear(Code c)
          Removes representation of Code c from this factory.
 Set getAllocatedTypes(HMethod hm)
          Returns an unmodifiable Set of HClasses.
 boolean isSafeMethod(HMethod hm)
          Checks whether a method is "safe" (i.e. whether all calls to a method occurs when the receiver object is the most recently allocated object.)
 MRA mra(Code c)
          Returns an MRA.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MRAFactory

public MRAFactory(ClassHierarchy ch,
                  HCodeFactory hcf,
                  Linker l,
                  String rName,
                  int optLevel)
Creates an MRAFactory. Requires a quad-ssa or quad-ssi codefactory. If the code is modified, a new MRAFactory is needed. For efficiency reasons, hcf should be a CachingCodeFactory.

Method Detail

mra

public MRA mra(Code c)
Returns an MRA.


clear

public void clear(Code c)
Removes representation of Code c from this factory.


isSafeMethod

public boolean isSafeMethod(HMethod hm)
Checks whether a method is "safe" (i.e. whether all calls to a method occurs when the receiver object is the most recently allocated object.)


allocatedTypesKnown

public boolean allocatedTypesKnown(HMethod hm)
Checks whether the types that the HMethod may allocate are known.


getAllocatedTypes

public Set getAllocatedTypes(HMethod hm)
Returns an unmodifiable Set of HClasses. The presence of an HClass in the Set indicates that the given HMethod may allocate, either directly or through calls, objects of that type.