public class UnifyAst extends Object
ControlFlowAnalyzer
in terms of reachability,
except that in some cases it's easier to be conservative and visit relatively
more nodes than CFA would.
Operates based on a work-queue to prevent recursion sickness.
Must handle:
- Type reference resolution
- Field and method reference resolution
- General code flow like ControlFlowAnalyzer
- GWT.create(), GWT.runAsync(), Impl.getNameOf()
- Stitch native methods into JsProgram
- Class.desiredAssertionStatus, Class.isClassMetaDataEnabled, GWT.isClient,
GWT.isProdMode, GWT.isScript.Modifier and Type | Field and Description |
---|---|
static String |
GWT_CREATE |
static String |
OLD_GWT_CREATE |
static String |
SYSTEM_GET_PROPERTY |
static String |
SYSTEM_GET_PROPERTY_WITH_DEFAULT |
Constructor and Description |
---|
UnifyAst(TreeLogger logger,
CompilerContext compilerContext,
JProgram program,
JsProgram jsProgram,
PrecompilationContext precompilationContext) |
Modifier and Type | Method and Description |
---|---|
void |
addRootTypes(Collection<String> rootTypeSourceNames) |
void |
buildEverything()
Special AST construction, useful for tests.
|
void |
exec()
Translates and stitches (unifies) type ASTs into one connected graph.
Only types reachable from entry points are traversed. |
JDeclaredType |
findType(String typeName,
com.google.gwt.dev.jjs.impl.UnifyAst.NameBasedTypeLocator nameBasedTypeLocator) |
com.google.gwt.dev.jjs.impl.UnifyAst.NameBasedTypeLocator |
getSourceNameBasedTypeLocator() |
public static final String GWT_CREATE
public static final String SYSTEM_GET_PROPERTY
public static final String SYSTEM_GET_PROPERTY_WITH_DEFAULT
public static final String OLD_GWT_CREATE
public UnifyAst(TreeLogger logger, CompilerContext compilerContext, JProgram program, JsProgram jsProgram, PrecompilationContext precompilationContext)
public void addRootTypes(Collection<String> rootTypeSourceNames)
public void buildEverything() throws UnableToCompleteException
UnableToCompleteException
public void exec() throws UnableToCompleteException
UnableToCompleteException
public com.google.gwt.dev.jjs.impl.UnifyAst.NameBasedTypeLocator getSourceNameBasedTypeLocator()
public JDeclaredType findType(String typeName, com.google.gwt.dev.jjs.impl.UnifyAst.NameBasedTypeLocator nameBasedTypeLocator) throws UnableToCompleteException
UnableToCompleteException
Copyright © 2018. All rights reserved.