All Downloads are FREE. Search and download functionalities are using the official Maven repository.

soot.jimple.infoflow.solver.gcSolver.AbstractGarbageCollector Maven / Gradle / Ivy

package soot.jimple.infoflow.solver.gcSolver;

import heros.solver.PathEdge;
import soot.SootMethod;
import soot.jimple.toolkits.ide.icfg.BiDiInterproceduralCFG;
import soot.util.ConcurrentHashMultiMap;

/**
 * Abstract base class for garbage collectors
 * 
 * @author Steven Arzt
 *
 */
public abstract class AbstractGarbageCollector implements IGarbageCollector {

	protected final BiDiInterproceduralCFG icfg;
	protected final IGCReferenceProvider referenceProvider;
	protected final ConcurrentHashMultiMap> jumpFunctions;

	public AbstractGarbageCollector(BiDiInterproceduralCFG icfg,
			ConcurrentHashMultiMap> jumpFunctions,
			IGCReferenceProvider referenceProvider) {
		this.icfg = icfg;
		this.referenceProvider = referenceProvider;
		this.jumpFunctions = jumpFunctions;
		initialize();
	}

	public AbstractGarbageCollector(BiDiInterproceduralCFG icfg,
			ConcurrentHashMultiMap> jumpFunctions) {
		this.icfg = icfg;
		this.referenceProvider = createReferenceProvider();
		this.jumpFunctions = jumpFunctions;
		initialize();
	}

	/**
	 * Initializes the garbage collector
	 */
	protected void initialize() {
	}

	/**
	 * Creates the reference provider that garbage collectors can use to identify
	 * dependencies
	 * 
	 * @return The new reference provider
	 */
	protected IGCReferenceProvider createReferenceProvider() {
		return new OnDemandReferenceProvider<>(icfg);
	}

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy