Class JSCallGraphUtil

  • Direct Known Subclasses:
    JSCallGraphBuilderUtil

    public class JSCallGraphUtil
    extends com.ibm.wala.cast.ipa.callgraph.CAstCallGraphUtil
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static JavaScriptTranslatorFactory translatorFactory
      the translator factory to be used for analysis TODO: pass the factory where needed instead of using a global?
      • Fields inherited from class com.ibm.wala.cast.ipa.callgraph.CAstCallGraphUtil

        AVOID_DUMP
    • Constructor Summary

      Constructors 
      Constructor Description
      JSCallGraphUtil()  
    • Field Detail

      • translatorFactory

        public static JavaScriptTranslatorFactory translatorFactory
        the translator factory to be used for analysis TODO: pass the factory where needed instead of using a global?
    • Constructor Detail

      • JSCallGraphUtil

        public JSCallGraphUtil()
    • Method Detail

      • setTranslatorFactory

        public static void setTranslatorFactory​(JavaScriptTranslatorFactory translatorFactory)
        Set up the translator factory. This method should be called before invoking makeLoaders().
      • makeOptions

        public static JSAnalysisOptions makeOptions​(com.ibm.wala.ipa.callgraph.AnalysisScope scope,
                                                    com.ibm.wala.ipa.cha.IClassHierarchy cha,
                                                    java.lang.Iterable<com.ibm.wala.ipa.callgraph.Entrypoint> roots)
      • makeLoaders

        public static JavaScriptLoaderFactory makeLoaders​(com.ibm.wala.cast.tree.rewrite.CAstRewriterFactory<?,​?> preprocessor)
        Parameters:
        preprocessor - CAst rewriter to use for preprocessing JavaScript source files; may be null
      • makeHierarchyForScripts

        public static com.ibm.wala.ipa.cha.IClassHierarchy makeHierarchyForScripts​(java.lang.String... scriptFiles)
                                                                            throws com.ibm.wala.ipa.cha.ClassHierarchyException
        Throws:
        com.ibm.wala.ipa.cha.ClassHierarchyException
      • makeHierarchy

        public static com.ibm.wala.ipa.cha.IClassHierarchy makeHierarchy​(com.ibm.wala.ipa.callgraph.AnalysisScope scope,
                                                                         com.ibm.wala.classLoader.ClassLoaderFactory loaders)
                                                                  throws com.ibm.wala.ipa.cha.ClassHierarchyException
        Throws:
        com.ibm.wala.ipa.cha.ClassHierarchyException
      • makeScriptRoots

        public static JavaScriptEntryPoints makeScriptRoots​(com.ibm.wala.ipa.cha.IClassHierarchy cha)
      • getNodes

        public static java.util.Collection<com.ibm.wala.ipa.callgraph.CGNode> getNodes​(com.ibm.wala.ipa.callgraph.CallGraph CG,
                                                                                       java.lang.String funName)
        Get all the nodes in CG with name funName. If funName is of the form "ctor:nm", return nodes corresponding to constructor function for nm. If funName is of the form "suffix:nm", return nodes corresponding to functions whose names end with nm. Otherwise, return nodes for functions whose name matches funName exactly.
      • getMethodReference

        public static com.ibm.wala.types.MethodReference getMethodReference​(java.lang.String funName)
      • loadAdditionalFile

        public static java.util.Set<java.lang.String> loadAdditionalFile​(com.ibm.wala.ipa.cha.IClassHierarchy cha,
                                                                         JavaScriptLoader cl,
                                                                         java.net.URL url)
                                                                  throws java.io.IOException
        Returns:
        The set of class names that where defined in the CHA as a result loading process.
        Throws:
        java.io.IOException
      • loadAdditionalFile

        public static java.util.Set<java.lang.String> loadAdditionalFile​(com.ibm.wala.ipa.cha.IClassHierarchy cha,
                                                                         JavaScriptLoader cl,
                                                                         com.ibm.wala.classLoader.ModuleEntry M)
                                                                  throws java.io.IOException
        Throws:
        java.io.IOException
      • simulateToStringForPropertyNames

        public static java.lang.String simulateToStringForPropertyNames​(java.lang.Object v)
      • getPrologueFile

        public static com.ibm.wala.classLoader.Module getPrologueFile​(java.lang.String name)