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

Side by Side Diff: pkg/front_end/lib/kernel_generator.dart

Issue 2874723002: Add a way to use shared CanonicalName root to deserialize Program. (Closed)
Patch Set: Always compute canonical names. Use shared name root. Created 3 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
OLDNEW
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 /// Defines the front-end API for converting source code to Dart Kernel objects. 5 /// Defines the front-end API for converting source code to Dart Kernel objects.
6 library front_end.kernel_generator; 6 library front_end.kernel_generator;
7 7
8 import 'compiler_options.dart'; 8 import 'compiler_options.dart';
9 import 'dart:async' show Future; 9 import 'dart:async' show Future;
10 import 'dart:async'; 10 import 'dart:async';
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after
47 return report("Entry-point file not found: $source"); 47 return report("Entry-point file not found: $source");
48 } 48 }
49 49
50 if (!await validateOptions(options)) return null; 50 if (!await validateOptions(options)) return null;
51 51
52 try { 52 try {
53 TranslateUri uriTranslator = await TranslateUri.parse( 53 TranslateUri uriTranslator = await TranslateUri.parse(
54 PhysicalFileSystem.instance, null, options.packagesFileUri); 54 PhysicalFileSystem.instance, null, options.packagesFileUri);
55 55
56 var dillTarget = 56 var dillTarget =
57 new DillTarget(new Ticker(isVerbose: false), uriTranslator); 57 new DillTarget(null, new Ticker(isVerbose: false), uriTranslator);
58 var summary = options.sdkSummary; 58 var summary = options.sdkSummary;
59 if (summary != null) dillTarget.read(summary); 59 if (summary != null) dillTarget.read(summary);
60 60
61 var kernelTarget = new KernelTarget( 61 var kernelTarget = new KernelTarget(
62 options.fileSystem, dillTarget, uriTranslator, options.strongMode); 62 options.fileSystem, dillTarget, uriTranslator, options.strongMode);
63 kernelTarget.read(source); 63 kernelTarget.read(source);
64 64
65 await dillTarget.writeOutline(null); 65 await dillTarget.writeOutline(null);
66 await kernelTarget.writeOutline(null); 66 await kernelTarget.writeOutline(null);
67 Program program = await kernelTarget.writeProgram(null); 67 Program program = await kernelTarget.writeProgram(null);
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
116 /// TODO(paulberry): would it be better to define a data type in kernel to 116 /// TODO(paulberry): would it be better to define a data type in kernel to
117 /// represent a bundle of all the libraries in a given build unit? 117 /// represent a bundle of all the libraries in a given build unit?
118 /// 118 ///
119 /// TODO(paulberry): does additional information need to be output to allow the 119 /// TODO(paulberry): does additional information need to be output to allow the
120 /// caller to match up referenced elements to the summary files they were 120 /// caller to match up referenced elements to the summary files they were
121 /// obtained from? 121 /// obtained from?
122 Future<Program> kernelForBuildUnit( 122 Future<Program> kernelForBuildUnit(
123 List<Uri> sources, CompilerOptions options) async { 123 List<Uri> sources, CompilerOptions options) async {
124 throw new UnimplementedError("kernel for build-unit is not implemented"); 124 throw new UnimplementedError("kernel for build-unit is not implemented");
125 } 125 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698