harpoon.Analysis.Quads
Class NewMover

java.lang.Object
  extended by harpoon.Analysis.Transformation.MethodMutator
      extended by harpoon.Analysis.Quads.NewMover
All Implemented Interfaces:
Serializable

public class NewMover
extends MethodMutator

The NewMover class moves NEW operations as close as possible to the CALL to their initializers. In java bytecode, these two operations can be arbitrarily far apart in expressions such as:

This movement is illegal if a OutOfMemoryException may ever be thrown, as moving the NEW changes where the exception would be thrown. However, FLEX operates under the assumption that such exceptions are never thrown.

NewMover works best on QuadWithTry form.

Version:
$Id: NewMover.java,v 1.7 2004/02/08 03:20:10 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
Serialized Form

Constructor Summary
NewMover(HCodeFactory hcf)
          Creates a NewMover that uses the given HCodeFactory hcf.
 
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

NewMover

public NewMover(HCodeFactory hcf)
Creates a NewMover that uses the given HCodeFactory hcf.

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