harpoon.Analysis.Quads
Class ComponentOfReducer

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

public class ComponentOfReducer
extends MethodMutator<Quad>

The ComponentOfReducer pass attempts to transform COMPONENTOF operations into (more efficient) INSTANCEOF operations, when this is safe to do. In particular, it is safe to transform o componentof a where a has type T[] into o instanceof T if a's type is exact or T is a final type.

This analysis needs type information for its input factory (a TypeMap or ExactTypeMap) and final type information (a Backend.Maps.FinalMap).

Version:
$Id: ComponentOfReducer.java,v 1.5 2004/07/01 22:24:03 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
Serialized Form

Constructor Summary
ComponentOfReducer(HCodeFactory hcf, ClassHierarchy ch)
           
ComponentOfReducer(HCodeFactory hcf, ExactTypeMap<Quad> tm, FinalMap fm)
          Creates a ComponentOfReducer.
ComponentOfReducer(HCodeFactory hcf, TypeMap<Quad> tm, FinalMap fm)
           
 
Method Summary
protected  HCode<Quad> mutateHCode(HCodeAndMaps<Quad> input)
          Override this method to effect transformations on split methods.
 
Methods inherited from class harpoon.Analysis.Transformation.MethodMutator
cloneHCode, codeFactory, mutateCodeName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ComponentOfReducer

public ComponentOfReducer(HCodeFactory hcf,
                          ExactTypeMap<Quad> tm,
                          FinalMap fm)
Creates a ComponentOfReducer.


ComponentOfReducer

public ComponentOfReducer(HCodeFactory hcf,
                          TypeMap<Quad> tm,
                          FinalMap fm)

ComponentOfReducer

public ComponentOfReducer(HCodeFactory hcf,
                          ClassHierarchy ch)
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>