| 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/dill/dill_library_builder.dart'; | 10 import 'package:front_end/src/fasta/dill/dill_library_builder.dart'; |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 158 /// file state prior the next invocation of [getKernel] returns the result. | 158 /// file state prior the next invocation of [getKernel] returns the result. |
| 159 /// | 159 /// |
| 160 /// Invocation of this method will not prevent a [Future] returned from | 160 /// Invocation of this method will not prevent a [Future] returned from |
| 161 /// [getKernel] from completing with a result, but the result is not | 161 /// [getKernel] from completing with a result, but the result is not |
| 162 /// guaranteed to be consistent with the new current file state after this | 162 /// guaranteed to be consistent with the new current file state after this |
| 163 /// [invalidate] invocation. | 163 /// [invalidate] invocation. |
| 164 void invalidate(Uri uri) { | 164 void invalidate(Uri uri) { |
| 165 _invalidatedFiles.add(uri); | 165 _invalidatedFiles.add(uri); |
| 166 } | 166 } |
| 167 | 167 |
| 168 /// Flush the current file state completely. | |
| 169 /// | |
| 170 /// TODO(scheglov) Do we really need this functionality? | |
| 171 void invalidateAll() { | |
| 172 _invalidatedFiles.addAll(_fsState.fileUris); | |
| 173 } | |
| 174 | |
| 175 /// Ensure that [dillTarget] includes the [cycle] libraries. It already | 168 /// Ensure that [dillTarget] includes the [cycle] libraries. It already |
| 176 /// contains all the libraries that sorted before the given [cycle] in | 169 /// contains all the libraries that sorted before the given [cycle] in |
| 177 /// topological order. Return the result with the cycle libraries. | 170 /// topological order. Return the result with the cycle libraries. |
| 178 Future<LibraryCycleResult> _compileCycle( | 171 Future<LibraryCycleResult> _compileCycle( |
| 179 CanonicalName nameRoot, DillTarget dillTarget, LibraryCycle cycle) async { | 172 CanonicalName nameRoot, DillTarget dillTarget, LibraryCycle cycle) async { |
| 180 return _logger.runAsync('Compile cycle $cycle', () async { | 173 return _logger.runAsync('Compile cycle $cycle', () async { |
| 181 String signature = _getCycleSignature(cycle); | 174 String signature = _getCycleSignature(cycle); |
| 182 | 175 |
| 183 _logger.writeln('Signature: $signature.'); | 176 _logger.writeln('Signature: $signature.'); |
| 184 var kernelKey = '$signature.kernel'; | 177 var kernelKey = '$signature.kernel'; |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 367 | 360 |
| 368 LibraryCycleResult(this.cycle, this.signature, this.kernelLibraries); | 361 LibraryCycleResult(this.cycle, this.signature, this.kernelLibraries); |
| 369 } | 362 } |
| 370 | 363 |
| 371 @visibleForTesting | 364 @visibleForTesting |
| 372 class _TestView { | 365 class _TestView { |
| 373 /// The list of [LibraryCycle]s compiled for the last delta. | 366 /// The list of [LibraryCycle]s compiled for the last delta. |
| 374 /// It does not include libraries which were read from the cache. | 367 /// It does not include libraries which were read from the cache. |
| 375 final List<LibraryCycle> compiledCycles = []; | 368 final List<LibraryCycle> compiledCycles = []; |
| 376 } | 369 } |
| OLD | NEW |