harpoon.Analysis.PreciseGC
Class WriteBarrierQuadPass

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

public class WriteBarrierQuadPass
extends MethodMutator

WriteBarrierQuadPass takes code in Quad form and inserts a fake call to a write barrier that is later replaced with a real implementation in WriteBarrierTreePass. When used without WriteBarrierTreePass and in combination with the mark-and-sweep collector, reports statistics about the number of times the write-barrier is called.

Version:
$Id: WriteBarrierQuadPass.java,v 1.5 2002/04/02 23:43:29 salcianu Exp $
Author:
Karen Zee <kkz@tmi.lcs.mit.edu>
See Also:
Serialized Form

Constructor Summary
WriteBarrierQuadPass(ClassHierarchy ch, HCodeFactory parent, Linker linker, String resourceName, int optLevel)
          Creates a WriteBarrierQuadPass.
 
Method Summary
 HCodeFactory ceCodeFactory(Frame f, HCodeFactory hcf)
          Return an HCodeFactory that will clean up the tree form of the transformed code by performing some optimizations which can't be represented in quad form; namely, removes write barriers for MOVEs that are assigned from constants.
 Data getData(HClass hc, Frame f)
          Data for gathering statistics on write barriers.
protected  HCode mutateHCode(HCodeAndMaps input)
          Override this method to effect transformations on split methods.
 HCodeFactory statsCodeFactory(Frame f, HCodeFactory hcf, ClassHierarchy ch, PrintStream out)
          Code factory for post pass.
 HCodeFactory treeCodeFactory(Frame f, HCodeFactory hcf, ClassHierarchy ch)
          Return an HCodeFactory that will clean up the tree form of the transformed code by performing some optimizations which can't be represented in quad form.
 
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

WriteBarrierQuadPass

public WriteBarrierQuadPass(ClassHierarchy ch,
                            HCodeFactory parent,
                            Linker linker,
                            String resourceName,
                            int optLevel)
Creates a WriteBarrierQuadPass. Write barrier removal performed if optimize is true.

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

treeCodeFactory

public HCodeFactory treeCodeFactory(Frame f,
                                    HCodeFactory hcf,
                                    ClassHierarchy ch)
Return an HCodeFactory that will clean up the tree form of the transformed code by performing some optimizations which can't be represented in quad form.


ceCodeFactory

public HCodeFactory ceCodeFactory(Frame f,
                                  HCodeFactory hcf)
Return an HCodeFactory that will clean up the tree form of the transformed code by performing some optimizations which can't be represented in quad form; namely, removes write barriers for MOVEs that are assigned from constants. This pass is needs to be run before the pass returned by treeCodeFactory to have any effect.


statsCodeFactory

public HCodeFactory statsCodeFactory(Frame f,
                                     HCodeFactory hcf,
                                     ClassHierarchy ch,
                                     PrintStream out)
Code factory for post pass. Emits data needed for gathering write barrier statistics. This pass needs to be run before the pass returned by treeCodeFactory to have any effect.


getData

public Data getData(HClass hc,
                    Frame f)
Data for gathering statistics on write barriers. Needs the results of the pass returned by statsCodeFactory.