|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.Analysis.MemOpt.IncompatibilityAnalysis
public class IncompatibilityAnalysis
Describe class IncompatibilityAnalysis
here.
Field Summary | |
---|---|
static boolean |
SHOW_PROGRESS
If true, the analysis will show progress dots and other progress indicators. |
static boolean |
SHOW_TIMINGS
If true, the analysis will show timings for all of its stages. |
static boolean |
SIZE_IN_BYTES
If true, compute the sizes of the classes in bytes, otherwise, compute them in fields (an approximation). |
static boolean |
STAY_IN_DECLARING_CLASS
If true, the analysis will not descend into classes other than the class of the entry method. |
static boolean |
VERBOSE_STATISTICS
If true, and SHOW_STATISTICS is also true,
printStatistics will show A LOT OF statistics when it finishes. |
Constructor Summary | |
---|---|
IncompatibilityAnalysis(HMethod entry,
HCodeFactory codeFactory,
CallGraph callGraph,
Linker linker)
Convenience form for the other constructor, calls it with callGraphNeedsSSA set to true. |
|
IncompatibilityAnalysis(HMethod entry,
HCodeFactory codeFactory,
CallGraph callGraph,
Linker linker,
boolean callGraphNeedsSSA)
Creates a new IncompatibilityAnalysis instance. |
Method Summary | |
---|---|
Collection |
allAllocationSites()
Returns all allocation sites encountered by this analysis. |
List |
allMethods()
Returns all the methods encountered by this analysis |
Collection |
getCompatibleClasses()
Returns a Collection whose members are disjunct
Collection of mutually compatible allocation sites
(NEW quads in SSI form). |
Collection |
getCompatibleClasses(Collection allocs)
Similar to the above, except it operates on a specified set of allocation sites. |
Quad |
getSSIQuad(Quad q)
Takes a Quad in NoSSA form, and returns the corresponding quad in SSI form, generated by the HCodeFactory used to
create this IncompatibilityAnalysis instance. |
boolean |
isIncompatible(HCodeElement e1,
HCodeElement e2)
Returns true if the given allocation sites cannot use the same memory to the best of our knowledge, i.e. we have not encountered one or both of them, or we have unable to prove thay can safely use the same memory. |
boolean |
isSelfIncompatible(HCodeElement e)
Returns true if the given site shound be dynamic to the best of our knowledge, i.e. if we haven't seen this site for some reason (e.g. it's not reachable from the entry method), or if we have been unable to prove it can be allocated statically. |
void |
printStatistics(Frame frame,
Linker linker)
|
static long |
sizeStatistics(Collection methods,
HCodeFactory factory)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final boolean STAY_IN_DECLARING_CLASS
public static final boolean SHOW_PROGRESS
public static final boolean VERBOSE_STATISTICS
SHOW_STATISTICS
is also true,
printStatistics will show A LOT OF statistics when it finishes.
public static final boolean SHOW_TIMINGS
public static boolean SIZE_IN_BYTES
Constructor Detail |
---|
public IncompatibilityAnalysis(HMethod entry, HCodeFactory codeFactory, CallGraph callGraph, Linker linker)
callGraphNeedsSSA
set to true.
public IncompatibilityAnalysis(HMethod entry, HCodeFactory codeFactory, CallGraph callGraph, Linker linker, boolean callGraphNeedsSSA)
IncompatibilityAnalysis
instance.
entry
- the entry methodcodeFactory
- a HCodeFactory
. This needs to be caching
and in SSI form.callGraph
- the CallGraph
the analysis should use.callGraphNeedsSSA
- hack that enables us to use Alex's
SmartCallGraph
, which only operates on NoSSA form. If
you set to true, make sure you have set
QuadSSI.KEEP_QUAD_MAP_HACK
to true. This is sucky, I
know, but there is no fast remedy.Method Detail |
---|
public Collection allAllocationSites()
Collection
of all the NEW
quads processed.public List allMethods()
List
of all methods processed (as
HMethod
s.)public boolean isSelfIncompatible(HCodeElement e)
NEW
quad in SSI form.
This takes the more general
e
- the allocation site. Right now, it must be a
NEW
quad in SSI form. This parameter has the more general
HCodeElement
because in the future we might want to support
other forms and/or ANEW
quads.
public boolean isIncompatible(HCodeElement e1, HCodeElement e2)
isSelfIncompatible()
to check whether the sites can be
allocated statically at all.
e1,e2
- the allocation sites. Right now, they must be
NEW
quads in SSI-form.
public Collection getCompatibleClasses()
Collection
whose members are disjunct
Collection
of mutually compatible allocation sites
(NEW
quads in SSI form). Every allocation site we
have encountered that can be made static is in one of these
classes.
Collection
of compatible static allocation
classes.public Collection getCompatibleClasses(Collection allocs)
allocs
- a Collection
of allocation sites to be
divided into compatible classes.
Collection
of compatible classes. Every
allocation site in alloc
that can be safely made static
is in one of these classes.public Quad getSSIQuad(Quad q)
HCodeFactory
used to
create this IncompatibilityAnalysis
instance. For
this to work correctly, our SSI factory *must* be a caching SSI
view of a caching SSA view. I wish I had any other way to do
this kind of "bridging", but there apparently is none.
q
- a Quad
in NoSSA form/ @return the
corresponding Quad
in SSI form, or null if we
couldn't find one (check the caching-SSI-of-caching-SSA
requirement)public void printStatistics(Frame frame, Linker linker)
public static long sizeStatistics(Collection methods, HCodeFactory factory)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |