Class JavaScriptLoader
java.lang.Object
com.ibm.wala.cast.loader.CAstAbstractLoader
com.ibm.wala.cast.loader.CAstAbstractModuleLoader
com.ibm.wala.cast.js.loader.JavaScriptLoader
- All Implemented Interfaces:
IClassLoader
-
Nested Class Summary
Nested classes/interfaces inherited from class CAstAbstractModuleLoader
CAstAbstractModuleLoader.CoreClass, CAstAbstractModuleLoader.DynamicCodeBody, CAstAbstractModuleLoader.DynamicMethodObjectModifier and TypeClassDescriptionclassclassclass -
Field Summary
FieldsModifier and TypeFieldDescriptionJavaScript files with code to model various aspects of the language semantics.static final LanguageFields inherited from class CAstAbstractLoader
cha, parent, typesModifier and TypeFieldDescriptionprotected final IClassHierarchyprotected final IClassLoadertypes loaded by this -
Constructor Summary
ConstructorsConstructorDescriptionJavaScriptLoader(IClassHierarchy cha, JavaScriptTranslatorFactory translatorFactory) JavaScriptLoader(IClassHierarchy cha, JavaScriptTranslatorFactory translatorFactory, CAstRewriterFactory<?, ?> preprocessor) -
Method Summary
Modifier and TypeMethodDescriptionstatic voidaddBootstrapFile(String fileName) defineCodeBodyCode(String clsName, AbstractCFG<?, ?> cfg, SymbolTable symtab, boolean hasCatchBlock, Map<IBasicBlock<SSAInstruction>, Set<TypeReference>> caughtTypes, boolean hasMonitorOp, AstTranslator.AstLexicalInformation lexicalInfo, AstMethod.DebuggingInformation debugInfo) defineFunctionType(String name, CAstSourcePositionMap.Position pos, CAstEntity entity, AstTranslator.WalkContext context) defineScriptType(String name, CAstSourcePositionMap.Position pos, CAstEntity entity, AstTranslator.WalkContext context) Return the ClassLoaderReference for this class loader.protected TranslatorToCAstgetTranslatorToCAst(CAst ast, ModuleEntry module, List<Module> allModules) create the appropriate CAst translator for the language and source moduleprotected TranslatorToIRinitTranslator(Set<Pair<CAstEntity, ModuleEntry>> topLevelEntities) create the appropriate IR translator for the languagemakeCodeBodyCode(AbstractCFG<?, ?> cfg, SymbolTable symtab, boolean hasCatchBlock, Map<IBasicBlock<SSAInstruction>, Set<TypeReference>> caughtTypes, boolean hasMonitorOp, AstTranslator.AstLexicalInformation lexicalInfo, AstMethod.DebuggingInformation debugInfo, IClass C) makeCodeBodyType(String name, TypeReference P, CAstSourcePositionMap.Position sourcePosition, CAstEntity entity, AstTranslator.WalkContext context) static voidstatic voidsetPrologueFile(String name) protected booleanshouldTranslate(CAstEntity entity) should IR be generated for entity?Methods inherited from class CAstAbstractModuleLoader
finishTranslation, getLocalFile, initModifier and TypeMethodDescriptionprotected voidsubclasses should override to perform actions after CAst and IR have been generated.protected FilevoidInitialize internal data structures.Methods inherited from class CAstAbstractLoader
addMessage, addMessages, clearMessages, getMessages, getModulesWithParseErrors, getModulesWithWarnings, getName, getNumberOfClasses, getNumberOfMethods, getParent, getSource, getSource, getSourceFileName, getSourceFileName, iterateAllClasses, lookupClass, lookupClass, removeAllModifier and TypeMethodDescriptionvoidaddMessage(ModuleEntry module, Warning message) voidaddMessages(ModuleEntry module, Set<Warning> message) voidgetName()intintgetSourceFileName(IClass klass) getSourceFileName(IMethod method, int bcOffset) lookupClass(TypeName className) Find and return the IClass defined by this class loader that corresponds to the given class name.lookupClass(String className, IClassHierarchy cha) voidremoveAll(Collection<IClass> toRemove) blow away references to any classes in the set
-
Field Details
-
JS
-
bootstrapFileNames
-
-
Constructor Details
-
JavaScriptLoader
-
JavaScriptLoader
public JavaScriptLoader(IClassHierarchy cha, JavaScriptTranslatorFactory translatorFactory, CAstRewriterFactory<?, ?> preprocessor)
-
-
Method Details
-
makeCodeBodyType
public IClass makeCodeBodyType(String name, TypeReference P, CAstSourcePositionMap.Position sourcePosition, CAstEntity entity, AstTranslator.WalkContext context) -
defineFunctionType
public IClass defineFunctionType(String name, CAstSourcePositionMap.Position pos, CAstEntity entity, AstTranslator.WalkContext context) -
defineScriptType
public IClass defineScriptType(String name, CAstSourcePositionMap.Position pos, CAstEntity entity, AstTranslator.WalkContext context) -
defineCodeBodyCode
public IMethod defineCodeBodyCode(String clsName, AbstractCFG<?, ?> cfg, SymbolTable symtab, boolean hasCatchBlock, Map<IBasicBlock<SSAInstruction>, Set<TypeReference>> caughtTypes, boolean hasMonitorOp, AstTranslator.AstLexicalInformation lexicalInfo, AstMethod.DebuggingInformation debugInfo) -
makeCodeBodyCode
public CAstAbstractModuleLoader.DynamicMethodObject makeCodeBodyCode(AbstractCFG<?, ?> cfg, SymbolTable symtab, boolean hasCatchBlock, Map<IBasicBlock<SSAInstruction>, Set<TypeReference>> caughtTypes, boolean hasMonitorOp, AstTranslator.AstLexicalInformation lexicalInfo, AstMethod.DebuggingInformation debugInfo, IClass C) -
getLanguage
- Returns:
- the unique name that identifies the programming language from which this class loader loads code.
-
getReference
Description copied from interface:IClassLoaderReturn the ClassLoaderReference for this class loader.- Returns:
- ClassLoaderReference
-
getInstructionFactory
-
resetPrologueFile
public static void resetPrologueFile() -
setPrologueFile
-
addBootstrapFile
-
getTranslatorToCAst
protected TranslatorToCAst getTranslatorToCAst(CAst ast, ModuleEntry module, List<Module> allModules) Description copied from class:CAstAbstractModuleLoadercreate the appropriate CAst translator for the language and source module- Specified by:
getTranslatorToCAstin classCAstAbstractModuleLoader- Parameters:
allModules- all modules in the analysis
-
initTranslator
Description copied from class:CAstAbstractModuleLoadercreate the appropriate IR translator for the language- Specified by:
initTranslatorin classCAstAbstractModuleLoader- Parameters:
topLevelEntities- the set of all modules being translated
-
shouldTranslate
Description copied from class:CAstAbstractModuleLoadershould IR be generated for entity?- Specified by:
shouldTranslatein classCAstAbstractModuleLoader
-