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.DynamicMethodObject -
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, types -
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>, 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>, 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, initMethods inherited from class CAstAbstractLoader
addMessage, addMessages, clearMessages, getMessages, getModulesWithParseErrors, getModulesWithWarnings, getName, getNumberOfClasses, getNumberOfMethods, getParent, getSource, getSource, getSourceFileName, getSourceFileName, iterateAllClasses, lookupClass, lookupClass, removeAll
-
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>, TypeReference[]> caughtTypes, boolean hasMonitorOp, AstTranslator.AstLexicalInformation lexicalInfo, AstMethod.DebuggingInformation debugInfo) -
makeCodeBodyCode
public CAstAbstractModuleLoader.DynamicMethodObject makeCodeBodyCode(AbstractCFG<?, ?> cfg, SymbolTable symtab, boolean hasCatchBlock, Map<IBasicBlock<SSAInstruction>, 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
-