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 | 6 |
7 import 'package:front_end/file_system.dart'; | 7 import 'package:front_end/file_system.dart'; |
8 import 'package:front_end/src/base/api_signature.dart'; | 8 import 'package:front_end/src/base/api_signature.dart'; |
9 import 'package:front_end/src/base/performace_logger.dart'; | 9 import 'package:front_end/src/base/performace_logger.dart'; |
10 import 'package:front_end/src/fasta/compiler_command_line.dart'; | 10 import 'package:front_end/src/fasta/compiler_command_line.dart'; |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
213 var reader = new BinaryBuilder(bytes); | 213 var reader = new BinaryBuilder(bytes); |
214 reader.readProgram(program); | 214 reader.readProgram(program); |
215 | 215 |
216 await appendNewDillLibraries(program); | 216 await appendNewDillLibraries(program); |
217 | 217 |
218 return new LibraryCycleResult(cycle, signature, program.libraries); | 218 return new LibraryCycleResult(cycle, signature, program.libraries); |
219 }); | 219 }); |
220 } | 220 } |
221 | 221 |
222 // Create KernelTarget and configure it for compiling the cycle URIs. | 222 // Create KernelTarget and configure it for compiling the cycle URIs. |
223 KernelTarget kernelTarget = | 223 KernelTarget kernelTarget = new KernelTarget( |
224 new KernelTarget(_fsState.fileSystemView, dillTarget, _uriTranslator); | 224 _fsState.fileSystemView, true, dillTarget, _uriTranslator); |
225 for (FileState library in cycle.libraries) { | 225 for (FileState library in cycle.libraries) { |
226 kernelTarget.read(library.uri); | 226 kernelTarget.read(library.uri); |
227 } | 227 } |
228 | 228 |
229 // Compile the cycle libraries into a new full program. | 229 // Compile the cycle libraries into a new full program. |
230 Program program = await _logger | 230 Program program = await _logger |
231 .runAsync('Compile ${cycle.libraries.length} libraries', () async { | 231 .runAsync('Compile ${cycle.libraries.length} libraries', () async { |
232 await kernelTarget.buildOutlines(nameRoot: nameRoot); | 232 await kernelTarget.buildOutlines(nameRoot: nameRoot); |
233 return await kernelTarget.buildProgram(); | 233 return await kernelTarget.buildProgram(); |
234 }); | 234 }); |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
369 | 369 |
370 LibraryCycleResult(this.cycle, this.signature, this.kernelLibraries); | 370 LibraryCycleResult(this.cycle, this.signature, this.kernelLibraries); |
371 } | 371 } |
372 | 372 |
373 @visibleForTesting | 373 @visibleForTesting |
374 class _TestView { | 374 class _TestView { |
375 /// The list of [LibraryCycle]s compiled for the last delta. | 375 /// The list of [LibraryCycle]s compiled for the last delta. |
376 /// It does not include libraries which were read from the cache. | 376 /// It does not include libraries which were read from the cache. |
377 final List<LibraryCycle> compiledCycles = []; | 377 final List<LibraryCycle> compiledCycles = []; |
378 } | 378 } |
OLD | NEW |