harpoon.Analysis.PreciseGC
Class AllocationHoisting

java.lang.Object
  extended by harpoon.Analysis.Transformation.MethodSplitter
      extended by harpoon.Analysis.PreciseGC.AllocationHoisting
All Implemented Interfaces:
Serializable

public class AllocationHoisting
extends MethodSplitter

AllocationHoisting

Version:
$Id: AllocationHoisting.java,v 1.6 2004/02/08 03:20:07 cananian Exp $
Author:
Karen Zee <kkz@tmi.lcs.mit.edu>
See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class harpoon.Analysis.Transformation.MethodSplitter
MethodSplitter.Token
 
Field Summary
static MethodSplitter.Token HOISTED
          Token for the hoisted version of an initializer.
 
Fields inherited from class harpoon.Analysis.Transformation.MethodSplitter
ORIGINAL
 
Constructor Summary
AllocationHoisting(HCodeFactory parent, ClassHierarchy ch, Linker l, String rName, int optLevel)
          Creates an AllocationHoisting.
 
Method Summary
protected  HCodeAndMaps cloneHCode(HCode hc, HMethod newmethod)
          Clones HCode and creates an iMap2 entry for the cloned code.
protected  boolean isValidToken(MethodSplitter.Token which)
          Check the validity of a given MethodSplitter.Token.
protected  String mutateDescriptor(HMethod hm, MethodSplitter.Token which)
          Adds parameter to descriptors of mutated methods.
protected  HCode mutateHCode(HCodeAndMaps input, MethodSplitter.Token which)
          Hoists allocation out of the split method.
 
Methods inherited from class harpoon.Analysis.Transformation.MethodSplitter
codeFactory, isVirtual, mutateCodeName, select
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

HOISTED

public static final MethodSplitter.Token HOISTED
Token for the hoisted version of an initializer.

Constructor Detail

AllocationHoisting

public AllocationHoisting(HCodeFactory parent,
                          ClassHierarchy ch,
                          Linker l,
                          String rName,
                          int optLevel)
Creates an AllocationHoisting. For efficiency, parent should be a CachingCodeFactory.

Parameters:
parent - The input code factory.
ch - A class hierarchy for the application.
Method Detail

mutateDescriptor

protected String mutateDescriptor(HMethod hm,
                                  MethodSplitter.Token which)
Adds parameter to descriptors of mutated methods.

Overrides:
mutateDescriptor in class MethodSplitter

mutateHCode

protected HCode mutateHCode(HCodeAndMaps input,
                            MethodSplitter.Token which)
Hoists allocation out of the split method.

Overrides:
mutateHCode in class MethodSplitter

cloneHCode

protected HCodeAndMaps cloneHCode(HCode hc,
                                  HMethod newmethod)
                           throws CloneNotSupportedException
Clones HCode and creates an iMap2 entry for the cloned code.

Overrides:
cloneHCode in class MethodSplitter
Throws:
CloneNotSupportedException

isValidToken

protected boolean isValidToken(MethodSplitter.Token which)
Check the validity of a given MethodSplitter.Token.

Overrides:
isValidToken in class MethodSplitter