Class Analyzer
- java.lang.Object
-
- com.ibm.wala.shrike.shrikeBT.analysis.Analyzer
-
- Direct Known Subclasses:
Verifier
public class Analyzer extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classAnalyzer.FailureExceptionThis exception is thrown by verify() when it fails.static classAnalyzer.PathElementstatic classAnalyzer.TypeVisitor
-
Field Summary
Fields Modifier and Type Field Description protected int[][]backEdgesprotected java.util.BitSetbasicBlockStartsprotected java.lang.StringclassTypeprotected ExceptionHandler[][]handlersprotected ClassHierarchyProviderhierarchyprotected IInstruction[]instructionsprotected int[]instToBCprotected booleanisConstructorprotected booleanisStaticprotected java.lang.String[][]localsprotected intmaxLocalsprotected intmaxStackprotected static int[]noEdgesprotected static java.lang.String[]noStringsprotected java.lang.Stringsignatureprotected java.lang.String[][]stacksprotected int[]stackSizesstatic java.lang.StringthisTypestatic java.lang.StringtopTypeprotected java.lang.String[][]varTypes
-
Constructor Summary
Constructors Modifier Constructor Description Analyzer(boolean isConstructor, boolean isStatic, java.lang.String classType, java.lang.String signature, IInstruction[] instructions, ExceptionHandler[][] handlers, int[] instToBC, java.lang.String[][] vars)protectedAnalyzer(MethodData info)protectedAnalyzer(MethodData info, int[] instToBC, java.lang.String[][] vars)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcomputeTypes(Analyzer.TypeVisitor v, java.util.BitSet makeTypesAt, boolean wantPath)Verify the method and compute types at every program point.static AnalyzercreateAnalyzer(MethodData info)java.lang.StringfindCommonSupertype(java.lang.String t1, java.lang.String t2)int[][]getBackEdges()java.util.BitSetgetBasicBlockStarts()IInstruction[]getInstructions()java.lang.String[][]getLocalTypes()java.util.BitSetgetReachableFrom(int from)java.util.BitSetgetReachableFrom(int from, boolean followHandlers, java.util.BitSet mask)voidgetReachableFromUpdate(int from, java.util.BitSet reachable, boolean followHandlers, java.util.BitSet mask)voidgetReachingToUpdate(int to, java.util.BitSet reaching, java.util.BitSet mask)int[]getStackSizes()java.lang.String[][]getStackTypes()protected voidinitTypeInfo()booleanisSubtypeOf(java.lang.String t1, java.lang.String t2)voidsetClassHierarchy(ClassHierarchyProvider h)Use class hierarchy information in 'h'.static java.lang.StringstripSharp(java.lang.String type)
-
-
-
Field Detail
-
thisType
public static final java.lang.String thisType
- See Also:
- Constant Field Values
-
topType
public static final java.lang.String topType
- See Also:
- Constant Field Values
-
isConstructor
protected final boolean isConstructor
-
isStatic
protected final boolean isStatic
-
classType
protected final java.lang.String classType
-
signature
protected final java.lang.String signature
-
instructions
protected final IInstruction[] instructions
-
handlers
protected final ExceptionHandler[][] handlers
-
hierarchy
protected ClassHierarchyProvider hierarchy
-
maxStack
protected int maxStack
-
maxLocals
protected int maxLocals
-
stacks
protected java.lang.String[][] stacks
-
locals
protected java.lang.String[][] locals
-
stackSizes
protected int[] stackSizes
-
basicBlockStarts
protected java.util.BitSet basicBlockStarts
-
backEdges
protected int[][] backEdges
-
instToBC
protected int[] instToBC
-
varTypes
protected java.lang.String[][] varTypes
-
noStrings
protected static final java.lang.String[] noStrings
-
noEdges
protected static final int[] noEdges
-
-
Constructor Detail
-
Analyzer
public Analyzer(boolean isConstructor, boolean isStatic, java.lang.String classType, java.lang.String signature, IInstruction[] instructions, ExceptionHandler[][] handlers, int[] instToBC, java.lang.String[][] vars)
-
Analyzer
protected Analyzer(MethodData info)
-
Analyzer
protected Analyzer(MethodData info, int[] instToBC, java.lang.String[][] vars)
-
-
Method Detail
-
setClassHierarchy
public final void setClassHierarchy(ClassHierarchyProvider h)
Use class hierarchy information in 'h'. If this method is not called or h provides only partial hierarchy information, the verifier behaves optimistically.
-
getBackEdges
public final int[][] getBackEdges()
-
isSubtypeOf
public final boolean isSubtypeOf(java.lang.String t1, java.lang.String t2)
-
findCommonSupertype
public final java.lang.String findCommonSupertype(java.lang.String t1, java.lang.String t2)
-
getBasicBlockStarts
public final java.util.BitSet getBasicBlockStarts()
-
getInstructions
public final IInstruction[] getInstructions()
-
getReachableFrom
public final java.util.BitSet getReachableFrom(int from)
-
getReachableFromUpdate
public final void getReachableFromUpdate(int from, java.util.BitSet reachable, boolean followHandlers, java.util.BitSet mask)
-
getReachableFrom
public final java.util.BitSet getReachableFrom(int from, boolean followHandlers, java.util.BitSet mask)
-
getReachingToUpdate
public final void getReachingToUpdate(int to, java.util.BitSet reaching, java.util.BitSet mask)
-
stripSharp
public static java.lang.String stripSharp(java.lang.String type)
-
getStackSizes
public int[] getStackSizes() throws Analyzer.FailureException- Throws:
Analyzer.FailureException
-
initTypeInfo
protected final void initTypeInfo() throws Analyzer.FailureException- Throws:
Analyzer.FailureException
-
computeTypes
public final void computeTypes(Analyzer.TypeVisitor v, java.util.BitSet makeTypesAt, boolean wantPath) throws Analyzer.FailureException
Verify the method and compute types at every program point.- Throws:
Analyzer.FailureException- the method contains invalid bytecode
-
getLocalTypes
public final java.lang.String[][] getLocalTypes()
- Returns:
- an array indexed by instruction index; each entry is an array of Strings giving the types of the locals at that instruction.
-
getStackTypes
public final java.lang.String[][] getStackTypes()
- Returns:
- an array indexed by instruction index; each entry is an array of Strings giving the types of the stack elements at that instruction. The top of the stack is the last element of the array.
-
createAnalyzer
public static Analyzer createAnalyzer(MethodData info)
-
-