harpoon.Analysis.Quads
Class ComponentOfReducer

java.lang.Object
  |
  +--harpoon.Analysis.Transformation.MethodMutator
        |
        +--harpoon.Analysis.Quads.ComponentOfReducer
All Implemented Interfaces:
Serializable

public class ComponentOfReducer
extends MethodMutator

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.2 2002/02/25 20:59:22 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 tm, FinalMap fm)
          Creates a ComponentOfReducer.
ComponentOfReducer(HCodeFactory hcf, TypeMap tm, FinalMap fm)
           
 
Method Summary
protected  HCode mutateHCode(HCodeAndMaps 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 tm,
                          FinalMap fm)
Creates a ComponentOfReducer.


ComponentOfReducer

public ComponentOfReducer(HCodeFactory hcf,
                          TypeMap tm,
                          FinalMap fm)

ComponentOfReducer

public ComponentOfReducer(HCodeFactory hcf,
                          ClassHierarchy ch)
Method Detail

mutateHCode

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

Overrides:
mutateHCode in class MethodMutator