|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectharpoon.Analysis.SizeOpt.BitWidthAnalysis
public class BitWidthAnalysis
BitWidthAnalysis
implements Sparse Conditional Constant
Propagation, with extensions to allow type and bitwidth analysis.
It combines the intraprocedural SCC analysis with an interprocedural
driver to infer the widths of object fields.
Only works with quads in SSI form.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface harpoon.Analysis.Maps.ExactTypeMap |
---|
ExactTypeMap.ExactType |
Nested classes/interfaces inherited from interface harpoon.Analysis.Maps.TypeMap |
---|
TypeMap.TypeNotKnownException |
Constructor Summary | |
---|---|
BitWidthAnalysis(Linker linker,
HCodeFactory hcf,
ClassHierarchy ch,
Set roots,
Set fieldRoots)
Creates a BitWidthAnalysis . |
|
BitWidthAnalysis(Linker linker,
HCodeFactory hcf,
ClassHierarchy ch,
Set roots,
String resourceName)
|
Method Summary | |
---|---|
Object |
constMap(HCodeElement hce,
Temp t)
Determine the constant value of Temp t . |
Object |
constMap(HField hf)
Determine the constant value of HField hf . |
boolean |
execMap(HCodeEdge edge)
Determine whether Edge e
is executable. |
boolean |
execMap(HCodeElement quad)
Determine whether Quad q
is executable. |
boolean |
isConst(HCodeElement hce,
Temp t)
Determine whether Temp t
has a constant value. |
boolean |
isConst(HField hf)
Determine whether HField hf
has a constant value. |
boolean |
isExactType(HCodeElement hce,
Temp t)
Determine whether the static type of Temp t
defined at hce is exact (or whether the runtime type
could be a subclass of the static type). |
boolean |
isPossiblyNull(HCodeElement hce,
Temp t)
Determine whether the given Temp can possibly be
null . |
boolean |
isRead(HField hf)
Determine whether the given HField is ever read. |
int |
minusWidthMap(HCodeElement hce,
Temp t)
Determine the negative bit width of Temp t . |
int |
minusWidthMap(HField hf)
Determine the negative bit width of HField
hf . |
int |
plusWidthMap(HCodeElement hce,
Temp t)
Determine the positive bit width of Temp t . |
int |
plusWidthMap(HField hf)
Determine the positive bit width of HField
hf . |
HClass |
typeMap(HCodeElement hce,
Temp t)
Determine the static type of Temp t in
HMethod m . |
HClass |
typeMap(HField hf)
Determine the static type of Temp t in
HMethod m . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BitWidthAnalysis(Linker linker, HCodeFactory hcf, ClassHierarchy ch, Set roots, String resourceName)
public BitWidthAnalysis(Linker linker, HCodeFactory hcf, ClassHierarchy ch, Set roots, Set fieldRoots)
BitWidthAnalysis
.
Method Detail |
---|
public boolean isRead(HField hf)
HField
is ever read.
public boolean execMap(HCodeElement quad)
Quad
q
is executable.
execMap
in interface ExecMap
quad
- The HCodeElement
to examine.
true
if it is possible to execute this
HCodeElement
; or false
if
it can be proved that this HCodeElement
will never be executed.public boolean execMap(HCodeEdge edge)
Edge
e
is executable.
execMap
in interface ExecMap
edge
- An edge between two HCodeElement
s in
some HCode
.
true
if it is possible to traverse this
edge during execution, or false
if it
can be proved that this edge will never be followed.public HClass typeMap(HCodeElement hce, Temp t)
Temp
t
in
HMethod
m
.
typeMap
in interface TypeMap
hce
- The HCodeElement
defining t
.t
- The temporary to examine.
t
.public HClass typeMap(HField hf)
Temp
t
in
HMethod
m
.
public boolean isExactType(HCodeElement hce, Temp t)
Temp
t
defined at hce
is exact (or whether the runtime type
could be a subclass of the static type).
isExactType
in interface ExactTypeMap
hce
- The HCodeElement
defining t
for
this request.t
- The Temp
to examine.
true
if t
's type is exact,
false
otherwise.public boolean isPossiblyNull(HCodeElement hce, Temp t)
Temp
can possibly be
null
.
public boolean isConst(HCodeElement hce, Temp t)
Temp
t
has a constant value.
isConst
in interface ConstMap
hce
- the definition point.t
- the Temp
to be examined.
true
is the given definition point can
be proven to give the specified Temp
a
constant value, false
otherwise.public Object constMap(HCodeElement hce, Temp t)
Temp
t
.
constMap
in interface ConstMap
hce
- the definition point.t
- the temporary to be examined.
Error
- if Temp
t
is not a constant.public boolean isConst(HField hf)
HField
hf
has a constant value.
public Object constMap(HField hf)
HField
hf
.
Error
- if HField
hf
is not a
constant.public int plusWidthMap(HCodeElement hce, Temp t)
Temp
t
.
public int minusWidthMap(HCodeElement hce, Temp t)
Temp
t
.
public int plusWidthMap(HField hf)
HField
hf
.
public int minusWidthMap(HField hf)
HField
hf
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |