harpoon.Analysis.Transformation
Class MethodMutator<HCE extends HCodeElement>

java.lang.Object
  extended by harpoon.Analysis.Transformation.MethodMutator<HCE>
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
AltArrayTransformer, ArrayInitRemover, ArrayUnroller, ClassReplacer, CoalescingToNoSSA, ComponentOfReducer, ConstantPropagation, DispatchTreeTransformation, DynamicWBInserter, DynamicWBQuadPass, FieldReducer, InstrumentAllocs, InstrumentAllocs2, MemoryOptimization, MethodTraceFactory, MostlyZeroFinder, NewMover, Nonvirtualize, QuantaChecker, RoleInference, RuntimeMethodCloner, SizeCounters, SyncRemover, TypeSwitchRemover, Virtualize, WriteBarrierInserter, WriteBarrierPrePass, WriteBarrierQuadPass

public abstract class MethodMutator<HCE extends HCodeElement>
extends Object
implements Serializable

MethodMutator makes it easier to implement simple method code mutations. It is meant to be subclassed. In your subclass, you will likely want to override mutateHCode() to effect the change.

Version:
$Id: MethodMutator.java,v 1.5 2002/09/01 07:46:31 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
Serialized Form

Constructor Summary
MethodMutator(HCodeFactory parent)
          Creates a MethodMutator.
 
Method Summary
protected  HCodeAndMaps<HCE> cloneHCode(HCode<HCE> 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.
 HCodeFactory codeFactory()
          Returns a HCodeFactory containing representations for the methods altered by the MethodMutator.
protected  String mutateCodeName(String codeName)
          Override this method to change the codename which this MethodMutator's codefactory reports.
protected  HCode<HCE> mutateHCode(HCodeAndMaps<HCE> input)
          Override this method to effect transformations on split methods.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MethodMutator

public MethodMutator(HCodeFactory parent)
Creates a MethodMutator.

Method Detail

mutateHCode

protected HCode<HCE> mutateHCode(HCodeAndMaps<HCE> input)
Override this method to effect transformations on split methods.


mutateCodeName

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


cloneHCode

protected HCodeAndMaps<HCE> cloneHCode(HCode<HCE> hc,
                                       HMethod newmethod)
                                                     throws CloneNotSupportedException
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).

Throws:
CloneNotSupportedException

codeFactory

public HCodeFactory codeFactory()
Returns a HCodeFactory containing representations for the methods altered by the MethodMutator.