public class JavaToJavaScriptCompiler extends Object
JProgram
representation into its corresponding
JavaScript source.Constructor and Description |
---|
JavaToJavaScriptCompiler() |
Modifier and Type | Method and Description |
---|---|
static PermutationResult |
compilePermutation(TreeLogger logger,
CompilerContext compilerContext,
UnifiedAst unifiedAst,
Permutation permutation)
Compiles a particular permutation, based on a precompiled unified AST.
|
protected static void |
draftOptimize(JProgram jprogram)
Perform the minimal amount of optimization to make sure the compile
succeeds.
|
static boolean |
findBooleanProperty(PropertyOracle[] propertyOracles,
TreeLogger logger,
String name,
String valueToFind,
boolean valueIfFound,
boolean valueIfNotFound,
boolean valueIfError)
Look for a selection property in all property oracles.
|
static int |
findIntegerConfigurationProperty(PropertyOracle[] propertyOracles,
TreeLogger logger,
String name,
int def)
Look for a configuration property in all property oracles.
|
protected static void |
optimize(JJSOptions options,
JProgram jprogram) |
protected static void |
optimizeJs(JJSOptions options,
JsProgram jsProgram,
Collection<JsNode> toInline) |
protected static OptimizerStats |
optimizeLoop(String passName,
JProgram jprogram,
JJSOptions options) |
protected static OptimizerStats |
optimizeLoop(String passName,
JProgram jprogram,
JJSOptions options,
int numNodes) |
static UnifiedAst |
precompile(TreeLogger logger,
CompilerContext compilerContext,
RebindPermutationOracle rpo,
String[] declEntryPts,
String[] additionalRootTypes,
boolean singlePermutation) |
static UnifiedAst |
precompile(TreeLogger logger,
CompilerContext compilerContext,
RebindPermutationOracle rpo,
String[] declEntryPts,
String[] additionalRootTypes,
boolean singlePermutation,
PrecompilationMetricsArtifact precompilationMetrics)
Performs a precompilation, returning a unified AST.
|
public static PermutationResult compilePermutation(TreeLogger logger, CompilerContext compilerContext, UnifiedAst unifiedAst, Permutation permutation) throws UnableToCompleteException
logger
- the logger to usecompilerContext
- shared read only compiler stateunifiedAst
- of stitched together per-type ASTspermutation
- the permutation to compileUnableToCompleteException
- if an error other than OutOfMemoryError
occurspublic static boolean findBooleanProperty(PropertyOracle[] propertyOracles, TreeLogger logger, String name, String valueToFind, boolean valueIfFound, boolean valueIfNotFound, boolean valueIfError)
public static int findIntegerConfigurationProperty(PropertyOracle[] propertyOracles, TreeLogger logger, String name, int def)
public static UnifiedAst precompile(TreeLogger logger, CompilerContext compilerContext, RebindPermutationOracle rpo, String[] declEntryPts, String[] additionalRootTypes, boolean singlePermutation) throws UnableToCompleteException
UnableToCompleteException
public static UnifiedAst precompile(TreeLogger logger, CompilerContext compilerContext, RebindPermutationOracle rpo, String[] declEntryPts, String[] additionalRootTypes, boolean singlePermutation, PrecompilationMetricsArtifact precompilationMetrics) throws UnableToCompleteException
logger
- the logger to usecompilerContext
- shared read only compiler staterpo
- the RebindPermutationOracledeclEntryPts
- the set of entry classes declared in a GWT module;
these will be automatically reboundadditionalRootTypes
- additional classes that should serve as code
roots; will not be rebound; may be null
singlePermutation
- if true, do not pre-optimize the resulting AST or
allow serialization of the resultprecompilationMetrics
- if not null, gather diagnostic information
from this build for a report.UnableToCompleteException
- if an error other than
OutOfMemoryError
occursprotected static void draftOptimize(JProgram jprogram)
protected static void optimize(JJSOptions options, JProgram jprogram) throws InterruptedException
InterruptedException
protected static void optimizeJs(JJSOptions options, JsProgram jsProgram, Collection<JsNode> toInline) throws InterruptedException
InterruptedException
protected static OptimizerStats optimizeLoop(String passName, JProgram jprogram, JJSOptions options)
protected static OptimizerStats optimizeLoop(String passName, JProgram jprogram, JJSOptions options, int numNodes)
Copyright © 2018. All rights reserved.