public abstract class PassConfig
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
(package private) static class |
PassConfig.PassConfigDelegate
An implementation of PassConfig that just proxies all its method calls
into an inner class.
|
static class |
PassConfig.State
Intermediate state for a running pass configuration.
|
Modifier and Type | Field and Description |
---|---|
private TypedScopeCreator |
internalScopeCreator
This is the scope creator that
TypedScopeCreator delegates to. |
(package private) CompilerOptions |
options |
(package private) TypedScope |
topScope
The global typed scope.
|
private MemoizedScopeCreator |
typedScopeCreator
A memoized version of scopeCreator.
|
Constructor and Description |
---|
PassConfig(CompilerOptions options) |
Modifier and Type | Method and Description |
---|---|
(package private) static void |
addPassFactoryBefore(java.util.List<PassFactory> factoryList,
PassFactory factory,
java.lang.String passName)
Insert the given pass factory before the factory of the given name.
|
(package private) void |
clearTypedScope() |
private static int |
findPassIndexByName(java.util.List<PassFactory> factoryList,
java.lang.String name)
Throws an exception if no pass with the given name exists.
|
(package private) PassConfig |
getBasePassConfig()
Find the first pass provider that does not have a delegate.
|
protected abstract java.util.List<PassFactory> |
getChecks()
Gets the checking passes to run.
|
protected abstract PassConfig.State |
getIntermediateState()
Get intermediate state for a running pass config, so it can
be paused and started again later.
|
protected abstract java.util.List<PassFactory> |
getOptimizations()
Gets the optimization passes to run.
|
(package private) GraphvizGraph |
getPassGraph()
Gets a graph of the passes run.
|
(package private) TypedScope |
getTopScope()
Gets the global scope, with type information.
|
(package private) MemoizedScopeCreator |
getTypedScopeCreator()
Gets the scope creator for typed scopes.
|
(package private) static InferJSDocInfo |
makeInferJsDocInfo(AbstractCompiler compiler) |
(package private) TypeCheck |
makeTypeCheck(AbstractCompiler compiler)
Create a type-checking pass.
|
(package private) TypeInferencePass |
makeTypeInference(AbstractCompiler compiler)
Create a type inference pass.
|
(package private) void |
patchGlobalTypedScope(AbstractCompiler compiler,
Node scriptRoot)
Regenerates the top scope potentially only for a sub-tree of AST and then
copies information for the old global scope.
|
(package private) void |
regenerateGlobalTypedScope(AbstractCompiler compiler,
Node root)
Regenerates the top scope from scratch.
|
(package private) static void |
replacePassFactory(java.util.List<PassFactory> factoryList,
PassFactory factory)
Find a pass factory with the same name as the given one, and replace it.
|
final CompilerOptions options
private MemoizedScopeCreator typedScopeCreator
private TypedScopeCreator internalScopeCreator
TypedScopeCreator
delegates to.TypedScope topScope
public PassConfig(CompilerOptions options)
void regenerateGlobalTypedScope(AbstractCompiler compiler, Node root)
compiler
- The compiler for which the global scope is regenerated.root
- The root of the AST.void clearTypedScope()
void patchGlobalTypedScope(AbstractCompiler compiler, Node scriptRoot)
compiler
- The compiler for which the global scope is generated.scriptRoot
- The root of the AST used to generate global scope.MemoizedScopeCreator getTypedScopeCreator()
TypedScope getTopScope()
protected abstract java.util.List<PassFactory> getChecks()
protected abstract java.util.List<PassFactory> getOptimizations()
GraphvizGraph getPassGraph()
final TypeInferencePass makeTypeInference(AbstractCompiler compiler)
static final InferJSDocInfo makeInferJsDocInfo(AbstractCompiler compiler)
final TypeCheck makeTypeCheck(AbstractCompiler compiler)
static final void addPassFactoryBefore(java.util.List<PassFactory> factoryList, PassFactory factory, java.lang.String passName)
static final void replacePassFactory(java.util.List<PassFactory> factoryList, PassFactory factory)
private static int findPassIndexByName(java.util.List<PassFactory> factoryList, java.lang.String name)
final PassConfig getBasePassConfig()
protected abstract PassConfig.State getIntermediateState()