Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(916)

Unified Diff: pkg/compiler/lib/src/dart2js.dart

Issue 2989453002: Add support for compiling Dart via the FE in dart2js. (Closed)
Patch Set: update status Created 3 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/dart2js.dart
diff --git a/pkg/compiler/lib/src/dart2js.dart b/pkg/compiler/lib/src/dart2js.dart
index bf3f3f9d750360425ffc958d3c69870ba81fe97f..34c0a996466a742b6c114314c00a78b7ca63c2bc 100644
--- a/pkg/compiler/lib/src/dart2js.dart
+++ b/pkg/compiler/lib/src/dart2js.dart
@@ -131,7 +131,7 @@ Future<api.CompilationResult> compile(List<String> argv) {
bool showWarnings;
bool showHints;
bool enableColors;
- bool loadFromDill = false;
+ bool useKernel = false;
// List of provided options that imply that output is expected.
List<String> optionsImplyCompilation = <String>[];
bool hasDisallowUnsafeEval = false;
@@ -278,8 +278,8 @@ Future<api.CompilationResult> compile(List<String> argv) {
passThrough('--categories=${categories.join(",")}');
}
- void setLoadFromDill(String argument) {
- loadFromDill = true;
+ void setPreviewDart2(String argument) {
+ useKernel = true;
passThrough(argument);
}
@@ -334,8 +334,8 @@ Future<api.CompilationResult> compile(List<String> argv) {
// TODO(efortuna): Remove this once kernel global inference is fully
// implemented.
new OptionHandler(Flags.kernelGlobalInference, passThrough),
- new OptionHandler(Flags.useKernel, passThrough),
- new OptionHandler(Flags.loadFromDill, setLoadFromDill),
+ new OptionHandler(Flags.useKernelInSsa, passThrough),
+ new OptionHandler(Flags.useKernel, setPreviewDart2),
new OptionHandler(Flags.noFrequencyBasedMinification, passThrough),
new OptionHandler(Flags.verbose, setVerbose),
new OptionHandler(Flags.version, (_) => wantVersion = true),
@@ -461,9 +461,6 @@ Future<api.CompilationResult> compile(List<String> argv) {
for (String hint in hints) {
diagnosticHandler.info(hint, api.Diagnostic.HINT);
}
- if (loadFromDill) {
- diagnosticHandler.autoReadFileUri = true;
- }
if (wantHelp || wantVersion) {
helpAndExit(wantHelp, wantVersion, diagnosticHandler.verbose);
@@ -581,6 +578,9 @@ Future<api.CompilationResult> compile(List<String> argv) {
}
Uri script = currentDirectory.resolve(arguments[0]);
+ if (useKernel && script.path.endsWith('.dill')) {
+ diagnosticHandler.autoReadFileUri = true;
+ }
CompilerOptions compilerOptions = new CompilerOptions.parse(
entryPoint: script,
libraryRoot: libraryRoot,

Powered by Google App Engine
This is Rietveld 408576698