public class TypeInference
extends java.lang.Object
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.
| Modifier and Type | Field and Description |
|---|---|
static boolean |
DEBUG |
| Constructor and Description |
|---|
TypeInference() |
| Modifier and Type | Method and Description |
|---|---|
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.
|
public static void transform(FlowGraph cfg, ClassHierarchy hier)
cfg - The control flow graph on which to perform TBAA.hier - A class heirarchy used for getting information about Types
(classes).SSAGraph,
ComponentVisitor,
TreeVisitor