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

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

Issue 2435203002: Emit API-only summaries (Closed)
Patch Set: Created 4 years, 2 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 | « no previous file | pkg/dev_compiler/lib/src/compiler/command.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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file
2 2
3 // for details. All rights reserved. Use of this source code is governed by a 3 // for details. All rights reserved. Use of this source code is governed by a
4 // BSD-style license that can be found in the LICENSE file. 4 // BSD-style license that can be found in the LICENSE file.
5 5
6 import 'dart:collection' show HashMap, HashSet; 6 import 'dart:collection' show HashMap, HashSet;
7 import 'dart:math' show min, max; 7 import 'dart:math' show min, max;
8 8
9 import 'package:analyzer/analyzer.dart' hide ConstantEvaluator; 9 import 'package:analyzer/analyzer.dart' hide ConstantEvaluator;
10 import 'package:analyzer/dart/ast/ast.dart'; 10 import 'package:analyzer/dart/ast/ast.dart';
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
210 210
211 summary_link 211 summary_link
212 .link( 212 .link(
213 uriToUnit.keys.toSet(), 213 uriToUnit.keys.toSet(),
214 (uri) => summaryData.linkedMap[uri], 214 (uri) => summaryData.linkedMap[uri],
215 (uri) => summaryData.unlinkedMap[uri] ?? uriToUnit[uri], 215 (uri) => summaryData.unlinkedMap[uri] ?? uriToUnit[uri],
216 context.declaredVariables.get, 216 context.declaredVariables.get,
217 true) 217 true)
218 .forEach(assembler.addLinkedLibrary); 218 .forEach(assembler.addLinkedLibrary);
219 219
220 return assembler.assemble().toBuffer(); 220 var bundle = assembler.assemble();
221 // Preserve only API-level information in the summary.
222 bundle.flushInformative();
223 return bundle.toBuffer();
221 } 224 }
222 225
223 JS.Program _emitModule(List<CompilationUnit> compilationUnits) { 226 JS.Program _emitModule(List<CompilationUnit> compilationUnits) {
224 if (_moduleItems.isNotEmpty) { 227 if (_moduleItems.isNotEmpty) {
225 throw new StateError('Can only call emitModule once.'); 228 throw new StateError('Can only call emitModule once.');
226 } 229 }
227 230
228 // Transform the AST to make coercions explicit. 231 // Transform the AST to make coercions explicit.
229 compilationUnits = CoercionReifier.reify(compilationUnits); 232 compilationUnits = CoercionReifier.reify(compilationUnits);
230 233
(...skipping 5288 matching lines...) Expand 10 before | Expand all | Expand 10 after
5519 } 5522 }
5520 5523
5521 bool isLibraryPrefix(Expression node) => 5524 bool isLibraryPrefix(Expression node) =>
5522 node is SimpleIdentifier && node.staticElement is PrefixElement; 5525 node is SimpleIdentifier && node.staticElement is PrefixElement;
5523 5526
5524 LibraryElement _getLibrary(AnalysisContext c, String uri) => 5527 LibraryElement _getLibrary(AnalysisContext c, String uri) =>
5525 c.computeLibraryElement(c.sourceFactory.forUri(uri)); 5528 c.computeLibraryElement(c.sourceFactory.forUri(uri));
5526 5529
5527 bool _isDartRuntime(LibraryElement l) => 5530 bool _isDartRuntime(LibraryElement l) =>
5528 l.isInSdk && l.source.uri.toString() == 'dart:_runtime'; 5531 l.isInSdk && l.source.uri.toString() == 'dart:_runtime';
OLDNEW
« no previous file with comments | « no previous file | pkg/dev_compiler/lib/src/compiler/command.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698