Class JSCallGraphBuilderUtil
java.lang.Object
com.ibm.wala.cast.ipa.callgraph.CAstCallGraphUtil
com.ibm.wala.cast.js.ipa.callgraph.JSCallGraphUtil
com.ibm.wala.cast.js.util.JSCallGraphBuilderUtil
TODO this class is a mess. rewrite.
-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class JSCallGraphUtil
JSCallGraphUtil.Bootstrap -
Field Summary
Fields inherited from class JSCallGraphUtil
translatorFactoryModifier and TypeFieldDescriptionstatic JavaScriptTranslatorFactorythe translator factory to be used for analysis TODO: pass the factory where needed instead of using a global?Fields inherited from class CAstCallGraphUtil
AVOID_DUMPModifier and TypeFieldDescriptionstatic final ThreadLocal<Boolean> flag to prevent dumping of verbose call graph / pointer analysis output -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic URLgetURLforFile(String dir, String name, ClassLoader loader) protected static JSCFABuildermakeCG(JavaScriptLoaderFactory loaders, AnalysisScope scope, JSCallGraphBuilderUtil.CGBuilderType builderType, IRFactory<IMethod> irFactory) static JSCFABuildermakeCGBuilder(JavaScriptLoaderFactory loaders, Module[] scripts, JSCallGraphBuilderUtil.CGBuilderType builderType, IRFactory<IMethod> irFactory) static CallGraphmakeHTMLCG(URL url) static CallGraphmakeHTMLCG(URL url, JSCallGraphBuilderUtil.CGBuilderType zeroOneCfaNoCallApply) static CallGraphmakeHTMLCG(URL url, JSCallGraphBuilderUtil.CGBuilderType builderType, Supplier<JSSourceExtractor> fExtractor) static CallGraphmakeHTMLCG(URL url, Supplier<JSSourceExtractor> fExtractor) static JSCFABuildermakeHTMLCGBuilder(URL url) static JSCFABuildermakeHTMLCGBuilder(URL url, JSCallGraphBuilderUtil.CGBuilderType type, Reader r) static JSCFABuildermakeHTMLCGBuilder(URL url, JSCallGraphBuilderUtil.CGBuilderType builderType, Supplier<JSSourceExtractor> fExtractor) static JSCFABuildermakeHTMLCGBuilder(URL url, JSCallGraphBuilderUtil.CGBuilderType builderType, Supplier<JSSourceExtractor> fExtractor, Reader r) static JSCFABuildermakeHTMLCGBuilder(URL url, Supplier<JSSourceExtractor> fExtractor) static JSCFABuildermakeHTMLCGBuilder(URL url, Supplier<JSSourceExtractor> fExtractor, Reader r) static SourceModule[]makeHtmlScope(URL url, JavaScriptLoaderFactory loaders, Supplier<JSSourceExtractor> fExtractor) static SourceModule[]makeHtmlScope(URL url, JavaScriptLoaderFactory loaders, Supplier<JSSourceExtractor> fExtractor, Reader r) static CallGraphmakeScriptCG(SourceModule[] scripts, JSCallGraphBuilderUtil.CGBuilderType builderType, IRFactory<IMethod> irFactory) static CallGraphmakeScriptCG(String dir, String name) static CallGraphmakeScriptCG(String dir, String name, JSCallGraphBuilderUtil.CGBuilderType builderType, ClassLoader loader) static CallGraphmakeScriptCG(String dir, String name, ClassLoader loader) static JSCFABuildermakeScriptCGBuilder(String dir, String name) static JSCFABuildermakeScriptCGBuilder(String dir, String name, JSCallGraphBuilderUtil.CGBuilderType builderType, ClassLoader loader) create a CG builder for script.static JSCFABuildermakeScriptCGBuilder(String dir, String name, ClassLoader loader) static JSCFABuilderstatic JSCFABuildermakeScriptCGBuilderWithoutCorrelationTracking(String dir, String name, ClassLoader loader) static AnalysisScopemakeScriptScope(String dir, String name, JavaScriptLoaderFactory loaders) static AnalysisScopemakeScriptScope(String dir, String name, JavaScriptLoaderFactory loaders, ClassLoader loader) static Module[]makeSourceModules(String dir, String name) static Module[]makeSourceModules(String dir, String name, ClassLoader loader) Methods inherited from class JSCallGraphUtil
getMethodReference, getNodes, getPrologueFile, getTranslatorFactory, loadAdditionalFile, loadAdditionalFile, makeHierarchy, makeHierarchyForScripts, makeLoaders, makeLoaders, makeOptions, makeScriptRoots, setTranslatorFactory, simulateToStringForPropertyNamesModifier and TypeMethodDescriptionstatic MethodReferencegetMethodReference(String funName) static Collection<CGNode> Get all the nodes in CG with name funName.static ModulegetPrologueFile(String name) static JavaScriptTranslatorFactoryloadAdditionalFile(IClassHierarchy cha, JavaScriptLoader cl, ModuleEntry M) loadAdditionalFile(IClassHierarchy cha, JavaScriptLoader cl, URL url) static IClassHierarchymakeHierarchy(AnalysisScope scope, ClassLoaderFactory loaders) static IClassHierarchymakeHierarchyForScripts(String... scriptFiles) static JavaScriptLoaderFactorystatic JavaScriptLoaderFactorymakeLoaders(CAstRewriterFactory<?, ?> preprocessor) static JSAnalysisOptionsmakeOptions(AnalysisScope scope, IClassHierarchy cha, Iterable<Entrypoint> roots) static JavaScriptEntryPointsstatic voidsetTranslatorFactory(JavaScriptTranslatorFactory translatorFactory) Set up the translator factory.static StringMethods inherited from class CAstCallGraphUtil
dumpCG, getShortName, getShortName, handleFileNames, makeCache, makeScope, makeScope, makeSourceModule, makeSourceModuleModifier and TypeMethodDescriptionstatic voiddumpCG(SSAContextInterpreter interp, PointerAnalysis<? extends InstanceKey> PA, CallGraph CG) static StringgetShortName(IMethod method) static StringgetShortName(CGNode nd) static SourceFileModule[]handleFileNames(String[] fileNameArgs) static IAnalysisCacheViewstatic AnalysisScopemakeScope(Module[] files, SingleClassLoaderFactory loaders, Language language) static AnalysisScopemakeScope(String[] files, SingleClassLoaderFactory loaders, Language language) static SourceFileModulemakeSourceModule(URL script, String scriptName) static SourceFileModulemakeSourceModule(URL script, String dir, String name)
-
Constructor Details
-
JSCallGraphBuilderUtil
public JSCallGraphBuilderUtil()
-
-
Method Details
-
makeScriptCGBuilder
public static JSCFABuilder makeScriptCGBuilder(String dir, String name, JSCallGraphBuilderUtil.CGBuilderType builderType, ClassLoader loader) throws IOException, WalaException create a CG builder for script. Note that the script at dir/name is loaded via the classloader, not from the filesystem.- Throws:
IOExceptionWalaException
-
getURLforFile
- Throws:
IOException
-
makeScriptScope
public static AnalysisScope makeScriptScope(String dir, String name, JavaScriptLoaderFactory loaders, ClassLoader loader) throws IOException - Throws:
IOException
-
makeScriptScope
public static AnalysisScope makeScriptScope(String dir, String name, JavaScriptLoaderFactory loaders) throws IOException - Throws:
IOException
-
makeSourceModules
- Throws:
IOException
-
makeSourceModules
public static Module[] makeSourceModules(String dir, String name, ClassLoader loader) throws IOException - Throws:
IOException
-
makeScriptCGBuilder
public static JSCFABuilder makeScriptCGBuilder(String dir, String name, ClassLoader loader) throws IOException, WalaException - Throws:
IOExceptionWalaException
-
makeScriptCGBuilder
public static JSCFABuilder makeScriptCGBuilder(String dir, String name) throws IOException, WalaException - Throws:
IOExceptionWalaException
-
makeScriptCG
public static CallGraph makeScriptCG(String dir, String name) throws IOException, IllegalArgumentException, CancelException, WalaException -
makeScriptCG
public static CallGraph makeScriptCG(String dir, String name, ClassLoader loader) throws IOException, IllegalArgumentException, CancelException, WalaException -
makeScriptCGBuilderWithoutCorrelationTracking
public static JSCFABuilder makeScriptCGBuilderWithoutCorrelationTracking(String dir, String name, ClassLoader loader) throws IOException, WalaException - Throws:
IOExceptionWalaException
-
makeScriptCGBuilderWithoutCorrelationTracking
public static JSCFABuilder makeScriptCGBuilderWithoutCorrelationTracking(String dir, String name) throws IOException, WalaException - Throws:
IOExceptionWalaException
-
makeScriptCG
public static CallGraph makeScriptCG(String dir, String name, JSCallGraphBuilderUtil.CGBuilderType builderType, ClassLoader loader) throws IOException, IllegalArgumentException, CancelException, WalaException -
makeScriptCG
public static CallGraph makeScriptCG(SourceModule[] scripts, JSCallGraphBuilderUtil.CGBuilderType builderType, IRFactory<IMethod> irFactory) throws IllegalArgumentException, CancelException, WalaException -
makeHTMLCGBuilder
public static JSCFABuilder makeHTMLCGBuilder(URL url, Supplier<JSSourceExtractor> fExtractor) throws WalaException - Throws:
WalaException
-
makeHTMLCGBuilder
public static JSCFABuilder makeHTMLCGBuilder(URL url, Supplier<JSSourceExtractor> fExtractor, Reader r) throws WalaException - Throws:
WalaException
-
makeHTMLCGBuilder
public static JSCFABuilder makeHTMLCGBuilder(URL url, JSCallGraphBuilderUtil.CGBuilderType builderType, Supplier<JSSourceExtractor> fExtractor) throws WalaException - Throws:
WalaException
-
makeHTMLCGBuilder
public static JSCFABuilder makeHTMLCGBuilder(URL url, JSCallGraphBuilderUtil.CGBuilderType builderType, Supplier<JSSourceExtractor> fExtractor, Reader r) throws WalaException - Throws:
WalaException
-
makeHtmlScope
public static SourceModule[] makeHtmlScope(URL url, JavaScriptLoaderFactory loaders, Supplier<JSSourceExtractor> fExtractor) -
makeHtmlScope
public static SourceModule[] makeHtmlScope(URL url, JavaScriptLoaderFactory loaders, Supplier<JSSourceExtractor> fExtractor, Reader r) -
makeHTMLCG
public static CallGraph makeHTMLCG(URL url, Supplier<JSSourceExtractor> fExtractor) throws IllegalArgumentException, CancelException, WalaException -
makeHTMLCG
public static CallGraph makeHTMLCG(URL url, JSCallGraphBuilderUtil.CGBuilderType builderType, Supplier<JSSourceExtractor> fExtractor) throws IllegalArgumentException, CancelException, WalaException -
makeCGBuilder
public static JSCFABuilder makeCGBuilder(JavaScriptLoaderFactory loaders, Module[] scripts, JSCallGraphBuilderUtil.CGBuilderType builderType, IRFactory<IMethod> irFactory) throws WalaException - Throws:
WalaException
-
makeCG
protected static JSCFABuilder makeCG(JavaScriptLoaderFactory loaders, AnalysisScope scope, JSCallGraphBuilderUtil.CGBuilderType builderType, IRFactory<IMethod> irFactory) throws WalaException - Throws:
WalaException
-
makeHTMLCG
public static CallGraph makeHTMLCG(URL url, JSCallGraphBuilderUtil.CGBuilderType zeroOneCfaNoCallApply) throws IllegalArgumentException, CancelException, WalaException -
makeHTMLCG
public static CallGraph makeHTMLCG(URL url) throws IllegalArgumentException, CancelException, WalaException -
makeHTMLCGBuilder
public static JSCFABuilder makeHTMLCGBuilder(URL url, JSCallGraphBuilderUtil.CGBuilderType type, Reader r) throws WalaException - Throws:
WalaException
-
makeHTMLCGBuilder
- Throws:
WalaException
-