Package soot.jimple.toolkits.typing.fast
Class TypeResolver
- java.lang.Object
-
- soot.jimple.toolkits.typing.fast.TypeResolver
-
public class TypeResolver extends Object
New Type Resolver by Ben Bellamy (see 'Efficient Local Type Inference' at OOPSLA 08). Ben has tested this code, and verified that it provides a typing that is at least as tight as the original algorithm (tighter in 2914 methods out of 295598) on a number of benchmarks. These are: abc-complete.jar, BlueJ, CSO (Scala code), Gant, Groovy, havoc.jar, Java 3D, jEdit, Java Grande Forum, Jigsaw, Jython, Kawa, rt.jar, Kawa, Scala and tools.jar. The mean execution time improvement is around 10 times, but for the longest methods (abc parser methods and havoc with >9000 statements) the improvement is between 200 and 500 times.- Author:
- Ben Bellamy
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description classTypeResolver.CastInsertionUseVisitor
-
Field Summary
Fields Modifier and Type Field Description protected JimpleBodyjb
-
Constructor Summary
Constructors Constructor Description TypeResolver(JimpleBody jb)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected Collection<Typing>applyAssignmentConstraints(Typing tg, IEvalFunction ef, IHierarchy h)protected Typeconvert(Type t)protected TypeResolver.CastInsertionUseVisitorcreateCastInsertionUseVisitor(Typing tg, IHierarchy h, boolean countOnly)Allows clients to provide an own visitor for cast insertionprotected List<Typing>createResultList()protected ArrayDeque<soot.jimple.toolkits.typing.fast.TypeResolver.WorklistElement>createSigmaQueue()protected ITypingStrategygetTypingStrategy()voidinferTypes()static booleantypesEqual(Type a, Type b)
-
-
-
Field Detail
-
jb
protected final JimpleBody jb
-
-
Constructor Detail
-
TypeResolver
public TypeResolver(JimpleBody jb)
-
-
Method Detail
-
inferTypes
public void inferTypes()
-
getTypingStrategy
protected ITypingStrategy getTypingStrategy()
-
createCastInsertionUseVisitor
protected TypeResolver.CastInsertionUseVisitor createCastInsertionUseVisitor(Typing tg, IHierarchy h, boolean countOnly)
Allows clients to provide an own visitor for cast insertion- Parameters:
tg- the typingh- the hierarchycountOnly- whether to count only (no actual changes)- Returns:
- the visitor
-
applyAssignmentConstraints
protected Collection<Typing> applyAssignmentConstraints(Typing tg, IEvalFunction ef, IHierarchy h)
-
createSigmaQueue
protected ArrayDeque<soot.jimple.toolkits.typing.fast.TypeResolver.WorklistElement> createSigmaQueue()
-
-