Package kilim.analysis
Class Value
- java.lang.Object
-
- kilim.analysis.Value
-
public class Value extends java.lang.ObjectA SSA value that represents all objects produced at a particular location in the code. Value objects are used by dataflow analysis (@see BasicBlock)
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description private intaddTo(int[] newSites, int site)intcategory()booleanequals(java.lang.Object obj)java.lang.ObjectgetConstVal()int[]getCreationSites()intgetNumSites()java.lang.StringgetTypeDesc()inthashCode()booleanisCategory1()booleanisCategory2()booleanisConstant()static Valuemake(int pos, java.lang.String desc)create a new Value with the given position and type and no constant valuestatic Valuemake(int pos, java.lang.String desc, java.lang.Object aConstVal)create a new ValueValuemerge(Detector det, Value other)Produces a new value (if necessary), if the instructions are different or the types are different.private intmergeSites(int[] newSites, Value other)java.lang.StringtoString()
-
-
-
Field Detail
-
NO_VAL
public static java.lang.Object NO_VAL
-
V_UNDEFINED
public static Value V_UNDEFINED
-
typeDesc
private java.lang.String typeDesc
-
constVal
private java.lang.Object constVal
-
numSites
private int numSites
-
sites
private int[] sites
-
-
Method Detail
-
getNumSites
public int getNumSites()
-
getCreationSites
public int[] getCreationSites()
-
getTypeDesc
public java.lang.String getTypeDesc()
-
getConstVal
public java.lang.Object getConstVal()
-
merge
public Value merge(Detector det, Value other)
Produces a new value (if necessary), if the instructions are different or the types are different. The types are merged to form a least common upper bound, and the instruction sets are unioned.- Parameters:
vb-- Returns:
- this if the result of the merge is no different, or the new value
-
mergeSites
private int mergeSites(int[] newSites, Value other)
-
addTo
private int addTo(int[] newSites, int site)
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
make
public static Value make(int pos, java.lang.String desc)
create a new Value with the given position and type and no constant value- Parameters:
pos- the position in the method for the corresponding instruction, or a unique value for method paramsdesc- the type descriptor- Returns:
- the new Value
-
make
public static Value make(int pos, java.lang.String desc, java.lang.Object aConstVal)
create a new Value- Parameters:
pos- the position in the method for the corresponding instruction, or a unique value for method paramsdesc- the type descriptoraConstVal- the constant value- Returns:
- the new Value
-
isCategory2
public boolean isCategory2()
-
isCategory1
public boolean isCategory1()
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
isConstant
public boolean isConstant()
-
category
public int category()
-
-