harpoon.Analysis.Quads
Class MemoryOptimization

java.lang.Object
  extended by harpoon.Analysis.Transformation.MethodMutator<Quad>
      extended by harpoon.Analysis.Quads.MemoryOptimization
All Implemented Interfaces:
Serializable

public final class MemoryOptimization
extends MethodMutator<Quad>

MemoryOptimization reduces the number of memory operations by combining multiple loads/stores to the same field/array element. It should be safe with respect to the revised Java memory model.

Version:
$Id: MemoryOptimization.java,v 1.7 2004/02/08 05:09:40 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
Serialized Form

Constructor Summary
MemoryOptimization(HCodeFactory parent, ClassHierarchy ch, CallGraph cg)
           
 
Method Summary
protected  HCodeAndMaps<Quad> cloneHCode(HCode<Quad> hc, HMethod newmethod)
          Override this method if you do not want the mutatable HCode to be a straight clone of the original HCode: for example, if the input HCodes were QuadSSI and you wanted to clone them into QuadRSSIs before mutating.
protected  String mutateCodeName(String codeName)
          Override this method to change the codename which this MethodMutator's codefactory reports.
protected  HCode<Quad> mutateHCode(HCodeAndMaps<Quad> input)
          Override this method to effect transformations on split methods.
 
Methods inherited from class harpoon.Analysis.Transformation.MethodMutator
codeFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MemoryOptimization

public MemoryOptimization(HCodeFactory parent,
                          ClassHierarchy ch,
                          CallGraph cg)
Method Detail

mutateHCode

protected HCode<Quad> mutateHCode(HCodeAndMaps<Quad> input)
Description copied from class: MethodMutator
Override this method to effect transformations on split methods.

Overrides:
mutateHCode in class MethodMutator<Quad>

cloneHCode

protected HCodeAndMaps<Quad> cloneHCode(HCode<Quad> hc,
                                        HMethod newmethod)
Description copied from class: MethodMutator
Override this method if you do not want the mutatable HCode to be a straight clone of the original HCode: for example, if the input HCodes were QuadSSI and you wanted to clone them into QuadRSSIs before mutating. By default, this method returns hc.clone(newmethod).

Overrides:
cloneHCode in class MethodMutator<Quad>

mutateCodeName

protected String mutateCodeName(String codeName)
Description copied from class: MethodMutator
Override this method to change the codename which this MethodMutator's codefactory reports.

Overrides:
mutateCodeName in class MethodMutator<Quad>