OLD | NEW |
1 // Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2017, 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 import 'dart:async'; | 5 import 'dart:async'; |
6 import 'dart:io'; | 6 import 'dart:io'; |
7 | 7 |
8 import 'package:front_end/file_system.dart'; | 8 import 'package:front_end/file_system.dart'; |
9 import 'package:front_end/incremental_kernel_generator.dart'; | 9 import 'package:front_end/incremental_kernel_generator.dart'; |
10 import 'package:front_end/src/base/api_signature.dart'; | 10 import 'package:front_end/src/base/api_signature.dart'; |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
93 // Ensure that the graph starting at the entry point is ready. | 93 // Ensure that the graph starting at the entry point is ready. |
94 FileState entryLibrary = await _fsState.getFile(_entryPoint); | 94 FileState entryLibrary = await _fsState.getFile(_entryPoint); |
95 | 95 |
96 List<LibraryCycle> cycles = _logger.run('Compute library cycles', () { | 96 List<LibraryCycle> cycles = _logger.run('Compute library cycles', () { |
97 List<LibraryCycle> cycles = entryLibrary.topologicalOrder; | 97 List<LibraryCycle> cycles = entryLibrary.topologicalOrder; |
98 _logger.writeln('Computed ${cycles.length} cycles.'); | 98 _logger.writeln('Computed ${cycles.length} cycles.'); |
99 return cycles; | 99 return cycles; |
100 }); | 100 }); |
101 | 101 |
102 CanonicalName nameRoot = new CanonicalName.root(); | 102 CanonicalName nameRoot = new CanonicalName.root(); |
103 DillTarget dillTarget = | 103 DillTarget dillTarget = new DillTarget( |
104 new DillTarget(new Ticker(isVerbose: false), _uriTranslator, "vm"); | 104 new Ticker(isVerbose: false), _uriTranslator, "vm_fasta"); |
105 | 105 |
106 List<_LibraryCycleResult> results = []; | 106 List<_LibraryCycleResult> results = []; |
107 await _logger.runAsync('Compute results for cycles', () async { | 107 await _logger.runAsync('Compute results for cycles', () async { |
108 for (LibraryCycle cycle in cycles) { | 108 for (LibraryCycle cycle in cycles) { |
109 _LibraryCycleResult result = | 109 _LibraryCycleResult result = |
110 await _compileCycle(nameRoot, dillTarget, cycle); | 110 await _compileCycle(nameRoot, dillTarget, cycle); |
111 results.add(result); | 111 results.add(result); |
112 } | 112 } |
113 }); | 113 }); |
114 | 114 |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
306 /// TODO(scheglov) Use API signatures. | 306 /// TODO(scheglov) Use API signatures. |
307 /// TODO(scheglov) Or use tree shaking and compute signatures of outlines. | 307 /// TODO(scheglov) Or use tree shaking and compute signatures of outlines. |
308 final String signature; | 308 final String signature; |
309 | 309 |
310 /// Kernel libraries for libraries in the [cycle]. Bodies of dependencies | 310 /// Kernel libraries for libraries in the [cycle]. Bodies of dependencies |
311 /// are not included, but but references to those dependencies are included. | 311 /// are not included, but but references to those dependencies are included. |
312 final List<Library> kernelLibraries; | 312 final List<Library> kernelLibraries; |
313 | 313 |
314 _LibraryCycleResult(this.cycle, this.signature, this.kernelLibraries); | 314 _LibraryCycleResult(this.cycle, this.signature, this.kernelLibraries); |
315 } | 315 } |
OLD | NEW |