harpoon.Util.BasicBlocks
Class CachingBBConverter

java.lang.Object
  extended by harpoon.Util.BasicBlocks.BBConverter
      extended by harpoon.Util.BasicBlocks.CachingBBConverter
All Implemented Interfaces:
Serializable

public class CachingBBConverter
extends BBConverter

CachingBBConverter provides some caching for the BBConverter. This is THE class to use if you need to obtain the BasicBlock view of the same method multiple times and don't want to litter all your code with caching mechanisms.

Version:
$Id: CachingBBConverter.java,v 1.2 2002/02/25 21:08:59 cananian Exp $
Author:
Alexandru SALCIANU <salcianu@retezat.lcs.mit.edu>
See Also:
Serialized Form

Field Summary
 
Fields inherited from class harpoon.Util.BasicBlocks.BBConverter
hcf, quad_with_try
 
Constructor Summary
CachingBBConverter(HCodeFactory hcf)
          Creates a CachingBBConverter.
 
Method Summary
 void clear()
          Completely clears the internal cache.
 void clear(HMethod hm)
          Remove from the internal cache the result for hm.
 BasicBlockFactoryInterf convert2bb(HMethod hm)
          Converts the code of the method hm to BasicBlock.Factory, a basic block view of hm's code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CachingBBConverter

public CachingBBConverter(HCodeFactory hcf)
Creates a CachingBBConverter.

Method Detail

convert2bb

public BasicBlockFactoryInterf convert2bb(HMethod hm)
Converts the code of the method hm to BasicBlock.Factory, a basic block view of hm's code. The code of the method is obtained from the HCodeFactory that was passed to the constructor of this.
Note: the results are cached.

Overrides:
convert2bb in class BBConverter

clear

public void clear(HMethod hm)
Remove from the internal cache the result for hm. This is useful if hm was modified and a new BasicBlock view needs to be generated for it.


clear

public void clear()
Completely clears the internal cache.