All Packages Class Hierarchy This Package Previous Next Index
HCodeFactory
makes an HCode
from an
HMethod
. For example, an
HCodeFactory
may make an harpoon.IR.QuadSSA.Code
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.
HCode
from an HMethod
.
HCode
that this factory produces.
public abstract HCode convert(HMethod m)
HCode
from an HMethod
.
This method should call the getCode
method of
m
to get the source representation for the
conversion. HMethod.getCode()
will take
care of properly caching the value convert
returns.
convert
is allowed to return null if the requested
conversion is impossible; typically this is because it's attempt
to getCode
a source representation failed -- for
example, because m
is a native method.
public abstract String getCodeName()
HCode
that this factory produces.
this.getCodeName()
should equal
this.convert(m).getName()
for every
HMethod m
.
All Packages Class Hierarchy This Package Previous Next Index