harpoon.ClassFile
Interface HCodeFactory

All Known Subinterfaces:
RegAlloc.IntermediateCodeFactory, SerializableCodeFactory
All Known Implementing Classes:
ArrayCopyImplementer, ArrayCopyInliner, CachingCodeFactory, CloneImplementer, LockRemove, MethodInliningCodeFactory, PreallocOpt.SafeCachingCodeFactory, PrintFactory, QuadCounter, SmallMethodInliner, UseDefChecker

public interface HCodeFactory

An HCodeFactory makes an HCode from an HMethod. For example, an HCodeFactory may make an harpoon.IR.Quads.QuadSSI from a harpoon.IR.Bytecode.Code, calling HMethod.getCode("bytecode") to get the source representation for the conversion. The HCodeFactory should call HMethod.putCode(this.getCodeName()) after conversion to cache the result.

Version:
$Id: HCodeFactory.java,v 1.5 2002/02/25 21:03:03 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>

Method Summary
 void clear(HMethod m)
          Removes representation of method m from all caches in this factory and its parents.
 HCode convert(HMethod m)
          Make an HCode from an HMethod.
 String getCodeName()
          Returns a string naming the type of the HCode that this factory produces.
 

Method Detail

convert

HCode convert(HMethod m)
Make an HCode from an HMethod.

convert is allowed to return null if the requested conversion is impossible; typically this is because it's attempt to convert a source representation failed -- for example, because m is a native method.


getCodeName

String getCodeName()
Returns a string naming the type of the HCode that this factory produces.

this.getCodeName() should equal this.convert(m).getName() for every HMethod m.


clear

void clear(HMethod m)
Removes representation of method m from all caches in this factory and its parents.