Class AbstractReferenceCountingGarbageCollector<N,D,A>

java.lang.Object
soot.jimple.infoflow.solver.gcSolver.AbstractGarbageCollector<N,D,A>
soot.jimple.infoflow.solver.gcSolver.AbstractReferenceCountingGarbageCollector<N,D,A>
All Implemented Interfaces:
IGarbageCollector<N,D>, IGarbageCollectorPeer<A>
Direct Known Subclasses:
FineGrainedReferenceCountingGarbageCollector, MethodLevelReferenceCountingGarbageCollector

public abstract class AbstractReferenceCountingGarbageCollector<N,D,A> extends AbstractGarbageCollector<N,D,A> implements IGarbageCollectorPeer<A>
Abstract base class for garbage collectors based on reference counting
Author:
Steven Arzt
  • Field Details

    • jumpFnCounter

      protected ConcurrentCountingMap<A> jumpFnCounter
    • gcScheduleSet

      protected final Set<A> gcScheduleSet
    • gcedAbstractions

      protected final AtomicInteger gcedAbstractions
    • gcedEdges

      protected final AtomicInteger gcedEdges
    • edgeCounterForThreshold

      protected final ExtendedAtomicInteger edgeCounterForThreshold
    • trigger

      protected GarbageCollectionTrigger trigger
    • peerGroup

      protected GarbageCollectorPeerGroup<A> peerGroup
    • checkChangeCounter

      protected boolean checkChangeCounter
    • validateEdges

      protected boolean validateEdges
    • oldEdges

      protected Set<heros.solver.PathEdge<N,D>> oldEdges
    • methodThreshold

      protected int methodThreshold
      The number of methods to collect as candidates for garbage collection, before halting the taint propagation and actually cleaning them up
    • edgeThreshold

      protected int edgeThreshold
      Wait for at least this number of edges before starting the garbage collection
  • Constructor Details

    • AbstractReferenceCountingGarbageCollector

      public AbstractReferenceCountingGarbageCollector(soot.jimple.toolkits.ide.icfg.BiDiInterproceduralCFG<N,soot.SootMethod> icfg, soot.util.ConcurrentHashMultiMap<A,heros.solver.PathEdge<N,D>> jumpFunctions, IGCReferenceProvider<A> referenceProvider)
    • AbstractReferenceCountingGarbageCollector

      public AbstractReferenceCountingGarbageCollector(soot.jimple.toolkits.ide.icfg.BiDiInterproceduralCFG<N,soot.SootMethod> icfg, soot.util.ConcurrentHashMultiMap<A,heros.solver.PathEdge<N,D>> jumpFunctions)
  • Method Details

    • genAbstraction

      protected abstract A genAbstraction(heros.solver.PathEdge<N,D> edge)
    • notifyEdgeSchedule

      public void notifyEdgeSchedule(heros.solver.PathEdge<N,D> edge)
      Description copied from interface: IGarbageCollector
      Notifies the garbage collector that a new edge has been scheduled for processing
      Specified by:
      notifyEdgeSchedule in interface IGarbageCollector<N,D>
      Parameters:
      edge - The edge that has been scheduled
    • notifyTaskProcessed

      public void notifyTaskProcessed(heros.solver.PathEdge<N,D> edge)
      Description copied from interface: IGarbageCollector
      Notifies the garbage collector that an edge has been fully processed
      Specified by:
      notifyTaskProcessed in interface IGarbageCollector<N,D>
      Parameters:
      edge - The edge has been fully processed
    • gcImmediate

      protected void gcImmediate()
      Immediately performs garbage collection
    • onBeforeRemoveEdges

      protected void onBeforeRemoveEdges()
      Method that is called before the first edge is removed from the jump functions
    • onAfterRemoveEdges

      protected void onAfterRemoveEdges()
      Method that is called after the last edge has been removed from the jump functions
      Parameters:
      gcedMethods - The number of methods for which edges have been removed
    • getGcedAbstractions

      public int getGcedAbstractions()
      Description copied from interface: IGarbageCollector
      Gets the number of methods for which taint abstractions were removed during garbage collection
      Specified by:
      getGcedAbstractions in interface IGarbageCollector<N,D>
      Returns:
      The number of methods for which taint abstractions were removed during garbage collection
    • getGcedEdges

      public int getGcedEdges()
      Description copied from interface: IGarbageCollector
      Gets the number of taint abstractions that were removed during garbage collection
      Specified by:
      getGcedEdges in interface IGarbageCollector<N,D>
      Returns:
      The number of taint abstractions that were removed during garbage collection
    • setMethodThreshold

      public void setMethodThreshold(int threshold)
      Sets the number of methods for which edges must have been added before garbage collection is started
      Parameters:
      threshold - The threshold of new methods required to trigger garbage collection
    • setEdgeThreshold

      public void setEdgeThreshold(int threshold)
      Sets the minimum number of edges that shall be propagated before triggering the garbage collection
      Parameters:
      threshold - The minimum number of edges that shall be propagated before triggering the garbage collection
    • setTrigger

      public void setTrigger(GarbageCollectionTrigger trigger)
      Set the trigger that defines when garbage collection shall be started
      Parameters:
      trigger - The trigger that defines when garbage collection shall be started
    • setPeerGroup

      public void setPeerGroup(GarbageCollectorPeerGroup<A> peerGroup)
      Sets the peer group in which this solver operates. Peer groups are used to synchronize active dependencies between multiple solvers.
      Parameters:
      peerGroup - The peer group
    • setCheckChangeCounter

      public void setCheckChangeCounter(boolean checkChangeCounter)
      Sets whether the change counter shall be checked when identifying active method dependencies
      Parameters:
      checkChangeCounter - True to ensure consistency using change counters, false otherwise