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 com.ibm.wala.cast.loader.CAstAbstractModuleLoader
CAstAbstractModuleLoader.CoreClass, CAstAbstractModuleLoader.DynamicCodeBody, CAstAbstractModuleLoader.DynamicMethodObject
-
Field Summary
Modifier and TypeFieldDescriptionJavaScript files with code to model various aspects of the language semantics.static final Language
Fields inherited from class com.ibm.wala.cast.loader.CAstAbstractLoader
cha, parent, types
-
Constructor Summary
ConstructorDescriptionJavaScriptLoader
(IClassHierarchy cha, JavaScriptTranslatorFactory translatorFactory) JavaScriptLoader
(IClassHierarchy cha, JavaScriptTranslatorFactory translatorFactory, CAstRewriterFactory<?, ?> preprocessor) -
Method Summary
Modifier and TypeMethodDescriptionstatic void
addBootstrapFile
(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 TranslatorToCAst
getTranslatorToCAst
(CAst ast, ModuleEntry module, List<Module> allModules) create the appropriate CAst translator for the language and source moduleprotected TranslatorToIR
initTranslator
(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 void
static void
setPrologueFile
(String name) protected boolean
shouldTranslate
(CAstEntity entity) should IR be generated for entity?Methods inherited from class com.ibm.wala.cast.loader.CAstAbstractModuleLoader
finishTranslation, getLocalFile, init
Methods inherited from class com.ibm.wala.cast.loader.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:IClassLoader
Return 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:CAstAbstractModuleLoader
create the appropriate CAst translator for the language and source module- Specified by:
getTranslatorToCAst
in classCAstAbstractModuleLoader
- Parameters:
allModules
- all modules in the analysis
-
initTranslator
Description copied from class:CAstAbstractModuleLoader
create the appropriate IR translator for the language- Specified by:
initTranslator
in classCAstAbstractModuleLoader
- Parameters:
topLevelEntities
- the set of all modules being translated
-
shouldTranslate
Description copied from class:CAstAbstractModuleLoader
should IR be generated for entity?- Specified by:
shouldTranslate
in classCAstAbstractModuleLoader
-