Package EDU.purdue.cs.bloat.tbaa
Class TypeInference
- java.lang.Object
-
- EDU.purdue.cs.bloat.tbaa.TypeInference
-
public class TypeInference extends java.lang.ObjectTyped-based alias analysis requires that we know the types of all entities in a method. However, local variables and stack variables do not have declared types. Thus, we have to infer them.TypeInference uses a simpilified version of everyone's favorite type inference algorithm from Object-Oriented Type Systems by Palsberg and Schwartzbach. It is simplified in that no interprocedural type information is calculated.
Here's how it works. Entities such as method arguments, fields, and constants have a known type. This known type is expressed in a constraint that constraints the entity to its type. Operations involving assignment (also phi-statements and stack operations) propagate these constraints to the targets of the assignments.
-
-
Field Summary
Fields Modifier and Type Field Description static booleanDEBUG
-
Constructor Summary
Constructors Constructor Description TypeInference()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static voidtransform(FlowGraph cfg, ClassHierarchy hier)Traverses the control flow graph and with the help of a number of vistors performs type-based alias analysis.
-
-
-
Method Detail
-
transform
public static void transform(FlowGraph cfg, ClassHierarchy hier)
Traverses the control flow graph and with the help of a number of vistors performs type-based alias analysis.- Parameters:
cfg- The control flow graph on which to perform TBAA.hier- A class heirarchy used for getting information about Types (classes).- See Also:
SSAGraph,ComponentVisitor,TreeVisitor
-
-