Class TBAA


  • public class TBAA
    extends java.lang.Object
    Performs Type-Based Alias Analysis (TBAA) to determine if one expression can alias another. An expression may alias another expression if there is the possibility that they refer to the same location in memory. BLOAT models expressions that may reference memory locations with MemRefExprs. There are two kinds of "access expressions" in Java: field accesses (FieldExpr and StaticFieldExpr) and array references (ArrayRefExpr). Access paths consist of one or more access expressions. For instance, a.b[i].c is an access expression.

    TBAA uses the FieldTypeDecl relation to determine whether or not two access paths may refer to the same memory location.

    AP1 AP2 FieldTypeDecl(AP1, Ap2)
    p p true
    p.f q.g (f = g) && FieldTypeDecl(p, q)
    p.f q[i] false
    p[i] q[j] FieldTypeDecl(p, q)
    p q TypeDecl(p, q)

    The TypeDecl(AP1, AP2) relation is defined as:

    Subtypes(Type(AP1)) INTERSECT Subtypes(Type(AP2)) != EMPTY

    The subtype relationships are determined by the ClassHierarchy.
    See Also:
    ClassHierarchy, MemRefExpr, FieldExpr, StaticFieldExpr, ArrayRefExpr
    • Constructor Summary

      Constructors 
      Constructor Description
      TBAA()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static boolean canAlias​(EditorContext context, Expr a, Expr b)
      Returns true, if expression a can alias expression b.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • TBAA

        public TBAA()
    • Method Detail

      • canAlias

        public static boolean canAlias​(EditorContext context,
                                       Expr a,
                                       Expr b)
        Returns true, if expression a can alias expression b.