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

Side by Side Diff: pkg/compiler/lib/src/compiler.dart

Issue 1975153002: Support (de)serialization from command-line (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 years, 7 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 unified diff | Download patch
« no previous file with comments | « pkg/compiler/lib/src/commandline_options.dart ('k') | pkg/compiler/lib/src/dart2js.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 library dart2js.compiler_base; 5 library dart2js.compiler_base;
6 6
7 import 'dart:async' show EventSink, Future; 7 import 'dart:async' show EventSink, Future;
8 8
9 import '../compiler_new.dart' as api; 9 import '../compiler_new.dart' as api;
10 import 'cache_strategy.dart' show CacheStrategy; 10 import 'cache_strategy.dart' show CacheStrategy;
(...skipping 346 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 checker = new TypeCheckerTask(this), 357 checker = new TypeCheckerTask(this),
358 typesTask = new ti.TypesTask(this), 358 typesTask = new ti.TypesTask(this),
359 constants = backend.constantCompilerTask, 359 constants = backend.constantCompilerTask,
360 deferredLoadTask = new DeferredLoadTask(this), 360 deferredLoadTask = new DeferredLoadTask(this),
361 mirrorUsageAnalyzerTask = new MirrorUsageAnalyzerTask(this), 361 mirrorUsageAnalyzerTask = new MirrorUsageAnalyzerTask(this),
362 enqueuer = backend.makeEnqueuer(), 362 enqueuer = backend.makeEnqueuer(),
363 dumpInfoTask = new DumpInfoTask(this), 363 dumpInfoTask = new DumpInfoTask(this),
364 reuseLibraryTask = new GenericTask('Reuse library', this), 364 reuseLibraryTask = new GenericTask('Reuse library', this),
365 selfTask = new GenericTask('self', this), 365 selfTask = new GenericTask('self', this),
366 ]; 366 ];
367 if (options.resolveOnly) {
368 serialization.supportSerialization = true;
369 }
367 370
368 _parsingContext = 371 _parsingContext =
369 new ParsingContext(reporter, options, parser, patchParser, backend); 372 new ParsingContext(reporter, options, parser, patchParser, backend);
370 373
371 tasks.addAll(backend.tasks); 374 tasks.addAll(backend.tasks);
372 } 375 }
373 376
374 /// Creates the scanner task. 377 /// Creates the scanner task.
375 /// 378 ///
376 /// Override this to mock the scanner for testing. 379 /// Override this to mock the scanner for testing.
(...skipping 474 matching lines...) Expand 10 before | Expand all | Expand 10 after
851 _reporter.reportSuppressedMessagesSummary(); 854 _reporter.reportSuppressedMessagesSummary();
852 855
853 if (compilationFailed) { 856 if (compilationFailed) {
854 if (!options.generateCodeWithCompileTimeErrors) return; 857 if (!options.generateCodeWithCompileTimeErrors) return;
855 if (!backend 858 if (!backend
856 .enableCodegenWithErrorsIfSupported(NO_LOCATION_SPANNABLE)) { 859 .enableCodegenWithErrorsIfSupported(NO_LOCATION_SPANNABLE)) {
857 return; 860 return;
858 } 861 }
859 } 862 }
860 863
864 if (options.resolveOnly) {
865 reporter.log('Serializing to ${options.resolutionOutput}');
866 serialization.serializeToSink(
867 userOutputProvider.createEventSink('', 'data'),
868 libraryLoader.libraries);
869 }
861 if (options.analyzeOnly) { 870 if (options.analyzeOnly) {
862 if (!analyzeAll && !compilationFailed) { 871 if (!analyzeAll && !compilationFailed) {
863 // No point in reporting unused code when [analyzeAll] is true: all 872 // No point in reporting unused code when [analyzeAll] is true: all
864 // code is artificially used. 873 // code is artificially used.
865 // If compilation failed, it is possible that the error prevents the 874 // If compilation failed, it is possible that the error prevents the
866 // compiler from analyzing all the code. 875 // compiler from analyzing all the code.
867 // TODO(johnniwinther): Reenable this when the reporting is more 876 // TODO(johnniwinther): Reenable this when the reporting is more
868 // precise. 877 // precise.
869 //reportUnusedCode(); 878 //reportUnusedCode();
870 } 879 }
(...skipping 1219 matching lines...) Expand 10 before | Expand all | Expand 10 after
2090 _ElementScanner(this.scanner); 2099 _ElementScanner(this.scanner);
2091 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library); 2100 void scanLibrary(LibraryElement library) => scanner.scanLibrary(library);
2092 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit); 2101 void scanUnit(CompilationUnitElement unit) => scanner.scan(unit);
2093 } 2102 }
2094 2103
2095 class _EmptyEnvironment implements Environment { 2104 class _EmptyEnvironment implements Environment {
2096 const _EmptyEnvironment(); 2105 const _EmptyEnvironment();
2097 2106
2098 String valueOf(String key) => null; 2107 String valueOf(String key) => null;
2099 } 2108 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/commandline_options.dart ('k') | pkg/compiler/lib/src/dart2js.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698