Class ContextSensitivity

java.lang.Object
qilin.core.config.ContextSensitivity
Direct Known Subclasses:
BeanObjectSensitivity, DataDrivenCallSiteSensitivity, DataDrivenHybridObjectSensitivity, DataDrivenObjectSensitivity, EagleObjectSensitivity, MahjongCallSiteSensitivity, MahjongObjectSensitivity, SelectxCallSiteSensitivity, TunnelingCallSiteSensitivity, TunnelingHybridObjectSensitivity, TunnelingObjectSensitivity, TunnelingTypeSensitivity, TurnerObjectSensitivity, ZipperCallSiteSensitivity, ZipperObjectSensitivity

public abstract class ContextSensitivity extends Object
Type-safe, IDE-assisted description of a pointer-analysis context-sensitivity variant. Each factory method validates its arguments at construction time instead of relying on regex parsing plus a hand-written compatibility matrix, and createPTA(qilin.core.PTAScene, qilin.core.config.PointerAnalysisConfig) builds the concrete BasePTA for the variant (context-debloating, where applicable, is applied per-variant here too) - this is the single place a PTA gets constructed from, covering both the core context-sensitivity variants (implemented alongside this class) and the research-toolkit ones (bean, zipper, eagle, turner, mahjong, selectx, data-driven, tunneling - each implemented in its own toolkit package, next to the *PTA class it builds). Not sealed: the toolkit implementations live in different packages, and this project has no module-info.java, so cross-package permits isn't available - the only publicly-constructible variants are still exactly the ones exposed by the factory methods below.
  • Constructor Details

    • ContextSensitivity

      protected ContextSensitivity()
  • Method Details

    • createContextConstructor

      public abstract ContextConstructor createContextConstructor()
      Builds the ContextConstructor implementing this context-sensitivity variant.
    • contextDepth

      public abstract int contextDepth()
      The method-context depth (k).
    • heapContextDepth

      public abstract int heapContextDepth()
      The heap-context depth (hk).
    • selectorContextDepth

      public int selectorContextDepth()
      The context depth passed to the UniformSelector. Equal to contextDepth() for every variant except hybrid-object-sensitivity, which selects on k+1.
    • createPTA

      public abstract BasePTA createPTA(PTAScene scene, PointerAnalysisConfig config)
      Builds the concrete BasePTA for this variant.
    • insensitive

      public static ContextSensitivity insensitive()
    • callSite

      public static ContextSensitivity callSite(int k)
    • callSite

      public static ContextSensitivity callSite(int k, int hk)
    • objectSensitive

      public static ContextSensitivity objectSensitive(int k)
    • objectSensitive

      public static ContextSensitivity objectSensitive(int k, int hk)
    • typeSensitive

      public static ContextSensitivity typeSensitive(int k, int hk)
    • hybridObjectSensitive

      public static ContextSensitivity hybridObjectSensitive(int k, int hk)
    • hybridTypeSensitive

      public static ContextSensitivity hybridTypeSensitive(int k, int hk)
    • beanObjectSensitive

      public static ContextSensitivity beanObjectSensitive()
      BEAN-guided 2-object-sensitivity. Only k=2/hk=1 is supported by BeanPTA.
    • zipperObjectSensitive

      public static ContextSensitivity zipperObjectSensitive(int k, int hk)
      ZIPPER-guided k-object-sensitivity.
    • zipperCallSite

      public static ContextSensitivity zipperCallSite(int k, int hk)
      ZIPPER-guided k-callsite-sensitivity.
    • zipperExpressObjectSensitive

      public static ContextSensitivity zipperExpressObjectSensitive(int k, int hk)
      Zipper-e (express): ZIPPER-guided k-object-sensitivity with the express-mode threshold cutoff.
    • zipperExpressCallSite

      public static ContextSensitivity zipperExpressCallSite(int k, int hk)
      Zipper-e (express): ZIPPER-guided k-callsite-sensitivity with the express-mode threshold cutoff.
    • eagleObjectSensitive

      public static ContextSensitivity eagleObjectSensitive(int k)
      EAGLE-guided k-object-sensitivity. Heap-context depth is always k-1.
    • turnerObjectSensitive

      public static ContextSensitivity turnerObjectSensitive(int k)
      TURNER-guided k-object-sensitivity.
    • mahjongObjectSensitive

      public static ContextSensitivity mahjongObjectSensitive(int k, int hk)
      MAHJONG-guided k-object-sensitivity.
    • mahjongCallSite

      public static ContextSensitivity mahjongCallSite(int k, int hk)
      MAHJONG-guided k-callsite-sensitivity.
    • dataDrivenObjectSensitive

      public static ContextSensitivity dataDrivenObjectSensitive()
      Data-driven 2-object-sensitivity. Only k=2/hk=1 is supported by DataDrivenPTA.
    • dataDrivenCallSite

      public static ContextSensitivity dataDrivenCallSite()
      Data-driven 2-callsite-sensitivity. Only k=2/hk=1 is supported by DataDrivenPTA.
    • dataDrivenHybridObjectSensitive

      public static ContextSensitivity dataDrivenHybridObjectSensitive()
      Data-driven hybrid-2-object-sensitivity. Only k=2/hk=1 is supported by DataDrivenPTA.
    • tunnelingObjectSensitive

      public static ContextSensitivity tunnelingObjectSensitive(int k, int hk)
      Tunneling k-object-sensitivity.
    • tunnelingCallSite

      public static ContextSensitivity tunnelingCallSite(int k, int hk)
      Tunneling k-callsite-sensitivity.
    • tunnelingTypeSensitive

      public static ContextSensitivity tunnelingTypeSensitive(int k, int hk)
      Tunneling k-type-sensitivity.
    • tunnelingHybridObjectSensitive

      public static ContextSensitivity tunnelingHybridObjectSensitive(int k, int hk)
      Tunneling hybrid-k-object-sensitivity.
    • selectxCallSite

      public static ContextSensitivity selectxCallSite(int k)
      SELECTX-guided k-callsite-sensitivity.
    • requireNonNegative

      protected static void requireNonNegative(int v, String name)
    • requirePositive

      protected static void requirePositive(int v)
    • requireObjectOrTypeHeapRange

      protected static void requireObjectOrTypeHeapRange(int k, int hk)
      Shared by every object/type-sensitive variant: hk must be k or k-1.
    • label

      protected static String label(String approach, int k, String ctxSuffix, int hk)
    • maybeDebloat

      protected static BasePTA maybeDebloat(BasePTA pta, PointerAnalysisConfig config)