harpoon.Analysis.Instr
Class BasePointerPreservingUseDefer

java.lang.Object
  extended by harpoon.IR.Properties.UseDefer
      extended by harpoon.Analysis.Instr.BasePointerPreservingUseDefer

public class BasePointerPreservingUseDefer
extends UseDefer

BasePointerPreservingUseDefer defines a view of the code where uses of derived pointer values are also considered uses of the base pointers that were used to compute the derived value. This forces the register allocator to keep base pointers alive (perhaps in stack locations, perhaps in registers).

A better implementation of this class would work to ensure that the usage counts of base pointers were not inflated too much by these semantics because the base values are not REALLY being used and so it would be a mistake to allocate them to registers most of the time. Perhaps the solution here is not in this class but in the uses OF this class.


Field Summary
 
Fields inherited from class harpoon.IR.Properties.UseDefer
DEFAULT
 
Constructor Summary
BasePointerPreservingUseDefer(UseDefer backing, Derivation deriv)
           
 
Method Summary
 Collection defC(HCodeElement hce)
          Returns a Collection of all the Temps that are defined by hce.
 Collection useC(HCodeElement hce)
          Returns a Collection of all the Temps that may be read by hce.
 
Methods inherited from class harpoon.IR.Properties.UseDefer
def, use
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BasePointerPreservingUseDefer

public BasePointerPreservingUseDefer(UseDefer backing,
                                     Derivation deriv)
Method Detail

useC

public Collection useC(HCodeElement hce)
Description copied from class: UseDefer
Returns a Collection of all the Temps that may be read by hce.

Specified by:
useC in class UseDefer

defC

public Collection defC(HCodeElement hce)
Description copied from class: UseDefer
Returns a Collection of all the Temps that are defined by hce.

Specified by:
defC in class UseDefer