harpoon.Analysis.Instr
Class DemandDrivenRegAlloc

java.lang.Object
  extended by harpoon.Analysis.Instr.RegAlloc
      extended by harpoon.Analysis.Instr.DemandDrivenRegAlloc

public class DemandDrivenRegAlloc
extends RegAlloc

DemandDrivenRegAlloc performs Demand-Driven Register Allocation for a set of Instrs in a Code.

Version:
$Id: DemandDrivenRegAlloc.java,v 1.2 2002/02/25 20:57:30 cananian Exp $
Author:
Felix S. Klock II <pnkfelix@mit.edu>

Nested Class Summary
 
Nested classes/interfaces inherited from class harpoon.Analysis.Instr.RegAlloc
RegAlloc.Factory, RegAlloc.IntermediateCode, RegAlloc.IntermediateCodeFactory, RegAlloc.RestoreProxy, RegAlloc.SpillLoad, RegAlloc.SpillProxy, RegAlloc.SpillStore
 
Field Summary
 
Fields inherited from class harpoon.Analysis.Instr.RegAlloc
bbFact, checked, code, DEBUG, frame, GLOBAL, LOCAL, TIME
 
Constructor Summary
protected DemandDrivenRegAlloc(Code code)
          Creates a DemandDrivenRegAlloc.
 
Method Summary
protected  void generateRegAssignment()
          Assigns registers in the code for this.
protected  Derivation getDerivation()
          stub implementation.
 
Methods inherited from class harpoon.Analysis.Instr.RegAlloc
abstractSpillFactory, abstractSpillFactory, allRegs, back, codeFactory, codeFactory, computeBasicBlocks, concreteSpillFactory, expand, fixupSpillCode, getBack, getGrapherFor, getUseDeferFor, hasRegister, isRegister, lastUse, reachableInstrs, replace, resolveOutstandingTemps, rfi
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DemandDrivenRegAlloc

protected DemandDrivenRegAlloc(Code code)
Creates a DemandDrivenRegAlloc.
Design Issue: should there be a RegAlloc object for every method, or just for every machine target? For now it seems associating a new one with every method will save a lot of headaches.
requires: 1. Local register allocation has been run on code already.

Method Detail

getDerivation

protected Derivation getDerivation()
stub implementation.

Specified by:
getDerivation in class RegAlloc

generateRegAssignment

protected void generateRegAssignment()
Description copied from class: RegAlloc
Assigns registers in the code for this.
effects: Partially or completely allocates registers for the values defined and used in the code for this. Values will be preserved in the code; any live value will be stored before its assigned register is overwritten.
Loads and Stores in general are added in the form of SpillLoads and SpillStores; the main RegAlloc class will use resolveOutstandingTemps() to replace these "fake" loads and stores with frame specified Memory instructions.

Specified by:
generateRegAssignment in class RegAlloc
See Also:
RegAlloc.resolveOutstandingTemps()