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 |
Constructor and Description |
---|
UnifyAst(TreeLogger logger,
CompilerContext compilerContext,
JProgram program,
JsProgram jsProgram,
RebindPermutationOracle rpo) |
Modifier and Type | Method and Description |
---|---|
void |
addRootTypes(Collection<String> sourceTypeNames) |
void |
buildEverything()
Special AST construction, useful for tests.
|
void |
exec()
Translates and stitches (unifies) type ASTs into one connected graph.
For normal monolithic compiles 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 OLD_GWT_CREATE
public UnifyAst(TreeLogger logger, CompilerContext compilerContext, JProgram program, JsProgram jsProgram, RebindPermutationOracle rpo)
public void addRootTypes(Collection<String> sourceTypeNames) throws UnableToCompleteException
UnableToCompleteException
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.