|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.ClassFile.CachingCodeFactory
public class CachingCodeFactory
A CachingCodeFactory
caches the conversions performed by
a parent HCodeFactory
; the cache can also be directly
modified in order to add or replace method implementations.
Field Summary | |
---|---|
HCodeFactory |
parent
Parent code factory. |
Constructor Summary | |
---|---|
CachingCodeFactory(HCodeFactory parent)
Creates a CachingCodeFactory using the conversions
performed by parent . |
|
CachingCodeFactory(HCodeFactory parent,
boolean saveCode)
Creates a CachingCodeFactory using the conversions
performed by parent . |
Method Summary | |
---|---|
void |
clear(HMethod m)
Remove the cached representation of m from this
CachingCodeFactory and its parent . |
HCode |
convert(HMethod m)
Convert a method to an HCode , caching the result. |
String |
getCodeName()
Returns the name of the HCode s generated by this
CachingCodeFactory . |
void |
put(HMethod m,
HCode hc)
Add or replace a representation for m to this
CachingCodeFactory . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public final HCodeFactory parent
CachingCodeFactory
caches.
Constructor Detail |
---|
public CachingCodeFactory(HCodeFactory parent)
CachingCodeFactory
using the conversions
performed by parent
. Cached HCode
s
will be flushed before this code factory is serialized.
public CachingCodeFactory(HCodeFactory parent, boolean saveCode)
CachingCodeFactory
using the conversions
performed by parent
. If saveCode
is
true
, cached HCode
s will *not* be
flushed before serialization.
Method Detail |
---|
public String getCodeName()
HCode
s generated by this
CachingCodeFactory
. Returns the same name as
parent
does.
getCodeName
in interface HCodeFactory
public HCode convert(HMethod m)
HCode
, caching the result.
Cached representations of m
in parent
are
cleared when this CachingCodeFactory
adds the
converted representation of m
to its cache.
convert
in interface HCodeFactory
public void clear(HMethod m)
m
from this
CachingCodeFactory
and its parent
.
clear
in interface HCodeFactory
public void put(HMethod m, HCode hc)
m
to this
CachingCodeFactory
. This can be used to update
the representation of a method with an optimized or otherwise
modified version. As a side-effect, clears any cached representations
of m
from parent
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |