/** * subclasses can override as desired */ protected ZeroXInstanceKeys makeInstanceKeys(IClassHierarchy cha, AnalysisOptions options, SSAContextInterpreter contextInterpreter, int instancePolicy) { ZeroXInstanceKeys zik = new ZeroXInstanceKeys(options, cha, contextInterpreter, instancePolicy); return zik; }
protected ZeroXInstanceKeys makeInstanceKeys(IClassHierarchy cha, AnalysisOptions options, SSAContextInterpreter contextInterpreter) { ZeroXInstanceKeys zik = new ZeroXInstanceKeys(options, cha, contextInterpreter, ZeroXInstanceKeys.ALLOCATIONS | ZeroXInstanceKeys.SMUSH_PRIMITIVE_HOLDERS | ZeroXInstanceKeys.SMUSH_STRINGS | ZeroXInstanceKeys.SMUSH_MANY | ZeroXInstanceKeys.SMUSH_THROWABLES); return zik; }
protected ZeroXInstanceKeys makeInstanceKeys(IClassHierarchy cha, AnalysisOptions options, SSAContextInterpreter contextInterpreter) { ZeroXInstanceKeys zik = new ZeroXInstanceKeys(options, cha, contextInterpreter, ZeroXInstanceKeys.ALLOCATIONS | ZeroXInstanceKeys.SMUSH_PRIMITIVE_HOLDERS | ZeroXInstanceKeys.SMUSH_STRINGS | ZeroXInstanceKeys.SMUSH_MANY | ZeroXInstanceKeys.SMUSH_THROWABLES); return zik; }
/** * subclasses can override as desired */ protected ZeroXInstanceKeys makeInstanceKeys(IClassHierarchy cha, AnalysisOptions options, SSAContextInterpreter contextInterpreter, int instancePolicy) { ZeroXInstanceKeys zik = new ZeroXInstanceKeys(options, cha, contextInterpreter, instancePolicy); return zik; }
public JSZeroOrOneXCFABuilder(IClassHierarchy cha, JSAnalysisOptions options, IAnalysisCacheView cache, ContextSelector appContextSelector, SSAContextInterpreter appContextInterpreter, int instancePolicy, boolean doOneCFA) { super(cha, options, cache); SSAContextInterpreter contextInterpreter = setupSSAContextInterpreter(cha, options, cache, appContextInterpreter); setupMethodTargetSelector(cha, options); setupContextSelector(options, appContextSelector, doOneCFA); setInstanceKeys(new JavaScriptScopeMappingInstanceKeys(cha, this, new JavaScriptConstructorInstanceKeys(new ZeroXInstanceKeys( options, cha, contextInterpreter, instancePolicy)))); }
public JSZeroOrOneXCFABuilder(IClassHierarchy cha, JSAnalysisOptions options, IAnalysisCacheView cache, ContextSelector appContextSelector, SSAContextInterpreter appContextInterpreter, int instancePolicy, boolean doOneCFA) { super(cha, options, cache); SSAContextInterpreter contextInterpreter = setupSSAContextInterpreter(cha, options, cache, appContextInterpreter); setupMethodTargetSelector(cha, options); setupContextSelector(options, appContextSelector, doOneCFA); setInstanceKeys(new JavaScriptScopeMappingInstanceKeys(cha, this, new JavaScriptConstructorInstanceKeys(new ZeroXInstanceKeys( options, cha, contextInterpreter, instancePolicy)))); }
public AstJavaZeroXCFABuilder(IClassHierarchy cha, AnalysisOptions options, IAnalysisCacheView cache, ContextSelector appContextSelector, SSAContextInterpreter appContextInterpreter, int instancePolicy) { super(cha, options, cache); SSAContextInterpreter contextInterpreter = makeDefaultContextInterpreters(appContextInterpreter, options, cha); setContextInterpreter(contextInterpreter); ContextSelector def = new DefaultContextSelector(options, cha); ContextSelector contextSelector = appContextSelector == null ? def : new DelegatingContextSelector(appContextSelector, def); setContextSelector(contextSelector); setInstanceKeys(new JavaScopeMappingInstanceKeys(this, new ZeroXInstanceKeys(options, cha, contextInterpreter, instancePolicy))); }
public AstJavaZeroXCFABuilder(IClassHierarchy cha, AnalysisOptions options, IAnalysisCacheView cache, ContextSelector appContextSelector, SSAContextInterpreter appContextInterpreter, int instancePolicy) { super(cha, options, cache); SSAContextInterpreter contextInterpreter = makeDefaultContextInterpreters(appContextInterpreter, options, cha); setContextInterpreter(contextInterpreter); ContextSelector def = new DefaultContextSelector(options, cha); ContextSelector contextSelector = appContextSelector == null ? def : new DelegatingContextSelector(appContextSelector, def); setContextSelector(contextSelector); setInstanceKeys(new JavaScopeMappingInstanceKeys(this, new ZeroXInstanceKeys(options, cha, contextInterpreter, instancePolicy))); }
/** * make a {@link CallGraphBuilder} that uses call-string context sensitivity, * with call-string length limited to n, and a context-sensitive * allocation-site-based heap abstraction. Standard optimizations in the heap * abstraction like smushing of strings are disabled. */ public static SSAPropagationCallGraphBuilder makeVanillaNCFABuilder(int n, AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha, AnalysisScope scope) { if (options == null) { throw new IllegalArgumentException("options is null"); } addDefaultSelectors(options, cha); addDefaultBypassLogic(options, scope, Util.class.getClassLoader(), cha); ContextSelector appSelector = null; SSAContextInterpreter appInterpreter = null; SSAPropagationCallGraphBuilder result = new nCFABuilder(n, Language.JAVA.getFakeRootMethod(cha, options, cache), options, cache, appSelector, appInterpreter); // nCFABuilder uses type-based heap abstraction by default, but we want allocation sites result.setInstanceKeys(new ZeroXInstanceKeys(options, cha, result.getContextInterpreter(), ZeroXInstanceKeys.ALLOCATIONS | ZeroXInstanceKeys.CONSTANT_SPECIFIC)); return result; }
/** * make a {@link CallGraphBuilder} that uses call-string context sensitivity, * with call-string length limited to n, and a context-sensitive * allocation-site-based heap abstraction. */ public static SSAPropagationCallGraphBuilder makeNCFABuilder(int n, AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha, AnalysisScope scope) { if (options == null) { throw new IllegalArgumentException("options is null"); } addDefaultSelectors(options, cha); addDefaultBypassLogic(options, scope, Util.class.getClassLoader(), cha); ContextSelector appSelector = null; SSAContextInterpreter appInterpreter = null; SSAPropagationCallGraphBuilder result = new nCFABuilder(n, Language.JAVA.getFakeRootMethod(cha, options, cache), options, cache, appSelector, appInterpreter); // nCFABuilder uses type-based heap abstraction by default, but we want allocation sites result.setInstanceKeys(new ZeroXInstanceKeys(options, cha, result.getContextInterpreter(), ZeroXInstanceKeys.ALLOCATIONS | ZeroXInstanceKeys.SMUSH_MANY | ZeroXInstanceKeys.SMUSH_PRIMITIVE_HOLDERS | ZeroXInstanceKeys.SMUSH_STRINGS | ZeroXInstanceKeys.SMUSH_THROWABLES)); return result; }
/** * make a {@link CallGraphBuilder} that uses call-string context sensitivity, * with call-string length limited to n, and a context-sensitive * allocation-site-based heap abstraction. Standard optimizations in the heap * abstraction like smushing of strings are disabled. */ public static SSAPropagationCallGraphBuilder makeVanillaNCFABuilder(int n, AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha, AnalysisScope scope) { if (options == null) { throw new IllegalArgumentException("options is null"); } addDefaultSelectors(options, cha); addDefaultBypassLogic(options, scope, Util.class.getClassLoader(), cha); ContextSelector appSelector = null; SSAContextInterpreter appInterpreter = null; SSAPropagationCallGraphBuilder result = new nCFABuilder(n, Language.JAVA.getFakeRootMethod(cha, options, cache), options, cache, appSelector, appInterpreter); // nCFABuilder uses type-based heap abstraction by default, but we want allocation sites result.setInstanceKeys(new ZeroXInstanceKeys(options, cha, result.getContextInterpreter(), ZeroXInstanceKeys.ALLOCATIONS | ZeroXInstanceKeys.CONSTANT_SPECIFIC)); return result; }
/** * make a {@link CallGraphBuilder} that uses call-string context sensitivity, * with call-string length limited to n, and a context-sensitive * allocation-site-based heap abstraction. */ public static SSAPropagationCallGraphBuilder makeNCFABuilder(int n, AnalysisOptions options, IAnalysisCacheView cache, IClassHierarchy cha, AnalysisScope scope) { if (options == null) { throw new IllegalArgumentException("options is null"); } addDefaultSelectors(options, cha); addDefaultBypassLogic(options, scope, Util.class.getClassLoader(), cha); ContextSelector appSelector = null; SSAContextInterpreter appInterpreter = null; SSAPropagationCallGraphBuilder result = new nCFABuilder(n, Language.JAVA.getFakeRootMethod(cha, options, cache), options, cache, appSelector, appInterpreter); // nCFABuilder uses type-based heap abstraction by default, but we want allocation sites result.setInstanceKeys(new ZeroXInstanceKeys(options, cha, result.getContextInterpreter(), ZeroXInstanceKeys.ALLOCATIONS | ZeroXInstanceKeys.SMUSH_MANY | ZeroXInstanceKeys.SMUSH_PRIMITIVE_HOLDERS | ZeroXInstanceKeys.SMUSH_STRINGS | ZeroXInstanceKeys.SMUSH_THROWABLES)); return result; }
public JavaJavaScriptHybridCallGraphBuilder(IMethod fakeRootClass, AnalysisOptions options, IAnalysisCacheView cache) { super(fakeRootClass, options, cache, new AstCFAPointerKeys()); globalObject = new GlobalObjectKey(cha.lookupClass(JavaScriptTypes.Root)); SSAContextInterpreter contextInterpreter = makeDefaultContextInterpreters(null, options, cha); setContextInterpreter( contextInterpreter ); ContextSelector def = new DefaultContextSelector(options, cha); Map<Atom,ContextSelector> languageSelectors = HashMapFactory.make(); languageSelectors.put(JavaScriptTypes.jsName, new JavaScriptFunctionApplyContextSelector(new JavaScriptConstructorContextSelector(def))); languageSelectors.put(Language.JAVA.getName(), def); setContextSelector(new CrossLanguageContextSelector(languageSelectors)); Map<Atom,InstanceKeyFactory> instanceKeys = HashMapFactory.make(); instanceKeys.put( JavaScriptTypes.jsName, new JavaScriptScopeMappingInstanceKeys(cha, this, new JavaScriptConstructorInstanceKeys(new ZeroXInstanceKeys( options, cha, contextInterpreter, ZeroXInstanceKeys.ALLOCATIONS)))); instanceKeys.put( Language.JAVA.getName(), new ZeroXInstanceKeys(options, cha, contextInterpreter, ZeroXInstanceKeys.NONE)); setInstanceKeys(new CrossLanguageInstanceKeys(instanceKeys)); }
builder.setInstanceKeys(new ZeroXInstanceKeys(options, cha, builder.getContextInterpreter(), ZeroXInstanceKeys.ALLOCATIONS