|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectharpoon.ClassFile.HCode<Quad>
harpoon.IR.Quads.Code
public abstract class Code
Quads.Code is an abstract superclass of codeviews
using the components in IR.Quads. It implements
shared methods for the various codeviews using Quads.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class harpoon.ClassFile.HCode |
|---|
HCode.PrintCallback<HCE extends HCodeElement> |
| Nested classes/interfaces inherited from interface harpoon.Util.Collections.Graph |
|---|
Graph.Edge<N extends Graph.Node<N,E>,E extends Graph.Edge<N,E>>, Graph.Node<N extends Graph.Node<N,E>,E extends Graph.Edge<N,E>> |
| Field Summary | |
|---|---|
protected AllocationInformation<Quad> |
ai
AllocationInformation for this HCode. |
protected HMethod |
parent
The method that this code view represents. |
protected QuadFactory |
qf
Quad factory. |
protected Quad |
quads
The quadruples composing this code view. |
| Constructor Summary | |
|---|---|
protected |
Code(HMethod parent,
Quad quads)
constructor. |
| Method Summary | |
|---|---|
abstract HCodeAndMaps<Quad> |
clone(HMethod newMethod)
Clone this code representation. |
protected HCodeAndMaps<Quad> |
cloneHelper(Code qc)
Helper for clone |
protected HCodeAndMaps<Quad> |
cloneHelper(Code _this,
Code qc)
Helper for clone |
ArrayFactory<Quad> |
elementArrayFactory()
Return an ArrayFactory for the HCodeElements
composing this HCode. |
AllocationInformation<Quad> |
getAllocationInformation()
Return the AllocationInformation for this codeview. |
Derivation<Quad> |
getDerivation()
Return a Derivation for this codeview. |
Quad[] |
getElements()
Deprecated. |
Iterator<Quad> |
getElementsI()
Returns an iterator over the Quads making up
this code view. |
Quad[] |
getLeafElements()
Returns the leaves of the control flow graph. |
HMethod |
getMethod()
Return the HMethod this codeview
belongs to. |
abstract String |
getName()
Return the name of this code view. |
HEADER |
getRootElement()
Returns the root of the control flow graph. |
protected QuadFactory |
newQF(HMethod parent)
Create a proper QuadFactory. |
Set<Quad> |
nodes()
Return the set of nodes comprising this Graph. |
void |
notifyReplace(Quad oldquad,
Quad newquad,
TempMap tm)
Subclasses of Code that want to be notified when
some optimization replace one of their quads with some other
quad can override this method. |
void |
print(PrintWriter pw,
HCode.PrintCallback<Quad> callback)
Pretty-print this code view using the specified callback. |
List<Quad> |
selectAllocations()
Returns the list of all allocation sites (ie, NEW
and ANEW quads) from this code. |
List<Quad> |
selectCALLs()
Returns the list of all CALL quads from
this code. |
List<Quad> |
selectQuads(QuadValueVisitor<Boolean> v)
Returns the list of all quads q from
this code for which q.accept(v) is
true. |
void |
setAllocationInformation(AllocationInformation<Quad> ai)
Set an AllocationInformation for this codeview. |
| Methods inherited from class harpoon.ClassFile.HCode |
|---|
clone, elementIndexer, getElementsL, print, toString |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected final HMethod parent
protected Quad quads
protected final QuadFactory qf
protected AllocationInformation<Quad> ai
AllocationInformation for this HCode.
| Constructor Detail |
|---|
protected Code(HMethod parent,
Quad quads)
| Method Detail |
|---|
protected QuadFactory newQF(HMethod parent)
public abstract HCodeAndMaps<Quad> clone(HMethod newMethod)
clone in class HCode<Quad>protected final HCodeAndMaps<Quad> cloneHelper(Code qc)
protected HCodeAndMaps<Quad> cloneHelper(Code _this,
Code qc)
public abstract String getName()
getName in class HCode<Quad>public HMethod getMethod()
HMethod this codeview
belongs to.
getMethod in class HCode<Quad>public AllocationInformation<Quad> getAllocationInformation()
AllocationInformation for this codeview.
public void setAllocationInformation(AllocationInformation<Quad> ai)
AllocationInformation for this codeview.
public Derivation<Quad> getDerivation()
Derivation for this codeview.
null, always.public HEADER getRootElement()
getRootElement in class HCode<Quad>null if this notion
is not applicable.public Quad[] getLeafElements()
getLeafElements in class HCode<Quad>null if this notion
is not applicable.public Quad[] getElements()
Quads
making up this code view. The root of the graph
is in element 0 of the array.
getElements in class HCode<Quad>Instrpublic Iterator<Quad> getElementsI()
Quads making up
this code view. The root of the graph is the first element
in the iteration.
getElementsI in class HCode<Quad>public ArrayFactory<Quad> elementArrayFactory()
HCodeArrayFactory for the HCodeElements
composing this HCode.
elementArrayFactory in class HCode<Quad>public Set<Quad> nodes()
Graph
nodes in interface Graph<Quad,Edge>
public void print(PrintWriter pw,
HCode.PrintCallback<Quad> callback)
HCode
print in class HCode<Quad>public List<Quad> selectQuads(QuadValueVisitor<Boolean> v)
q from
this code for which q.accept(v) is
true.
public List<Quad> selectCALLs()
CALL quads from
this code.
public List<Quad> selectAllocations()
NEW
and ANEW quads) from this code.
public void notifyReplace(Quad oldquad,
Quad newquad,
TempMap tm)
Code that want to be notified when
some optimization replace one of their quads with some other
quad can override this method. This can be useful for
updating mappings that attach information to quads (i.e.,
allocation policies, QuadNoSSA to QuadSSI mappings etc.). See
the code of DeadCode.replace for an example.
oldquad - quad that is being replacednewquad - new quad that replaces oldquadtm - maps old temps to new temps
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||