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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 /// The compiler options, such as the [FileSystem], the SDK dill location, | 52 /// The compiler options, such as the [FileSystem], the SDK dill location, |
53 /// etc. | 53 /// etc. |
54 final ProcessedOptions _options; | 54 final ProcessedOptions _options; |
55 | 55 |
56 /// The object that knows how to resolve "package:" and "dart:" URIs. | 56 /// The object that knows how to resolve "package:" and "dart:" URIs. |
57 final TranslateUri _uriTranslator; | 57 final TranslateUri _uriTranslator; |
58 | 58 |
59 /// The logger to report compilation progress. | 59 /// The logger to report compilation progress. |
60 final PerformanceLog _logger; | 60 final PerformanceLog _logger; |
61 | 61 |
62 /// The current file system state. | |
63 final FileSystemState _fsState; | |
64 | |
65 /// The byte storage to get and put serialized data. | 62 /// The byte storage to get and put serialized data. |
66 final ByteStore _byteStore; | 63 final ByteStore _byteStore; |
67 | 64 |
68 /// The URI of the program entry point. | 65 /// The URI of the program entry point. |
69 final Uri _entryPoint; | 66 final Uri _entryPoint; |
70 | 67 |
71 /// The salt to mix into all hashes used as keys for serialized data. | 68 /// The salt to mix into all hashes used as keys for serialized data. |
72 List<int> _salt; | 69 List<int> _salt; |
73 | 70 |
| 71 /// The current file system state. |
| 72 FileSystemState _fsState; |
| 73 |
74 /// Latest compilation signatures produced by [computeDelta] for libraries. | 74 /// Latest compilation signatures produced by [computeDelta] for libraries. |
75 final Map<Uri, String> _latestSignature = {}; | 75 final Map<Uri, String> _latestSignature = {}; |
76 | 76 |
77 /// The set of absolute file URIs that were reported through [invalidate] | 77 /// The set of absolute file URIs that were reported through [invalidate] |
78 /// and not checked for actual changes yet. | 78 /// and not checked for actual changes yet. |
79 final Set<Uri> _invalidatedFiles = new Set<Uri>(); | 79 final Set<Uri> _invalidatedFiles = new Set<Uri>(); |
80 | 80 |
81 IncrementalKernelGeneratorImpl( | 81 IncrementalKernelGeneratorImpl( |
82 this._options, this._uriTranslator, this._entryPoint) | 82 this._options, this._uriTranslator, this._entryPoint) |
83 : _logger = _options.logger, | 83 : _logger = _options.logger, |
84 _fsState = new FileSystemState(_options.fileSystem, _uriTranslator), | |
85 _byteStore = _options.byteStore { | 84 _byteStore = _options.byteStore { |
86 _computeSalt(); | 85 _computeSalt(); |
| 86 _fsState = new FileSystemState(_options.fileSystem, _uriTranslator, _salt); |
87 } | 87 } |
88 | 88 |
89 @override | 89 @override |
90 Future<DeltaProgram> computeDelta( | 90 Future<DeltaProgram> computeDelta( |
91 {Future<Null> watch(Uri uri, bool used)}) async { | 91 {Future<Null> watch(Uri uri, bool used)}) async { |
92 return await _logger.runAsync('Compute delta', () async { | 92 return await _logger.runAsync('Compute delta', () async { |
93 await _refreshInvalidatedFiles(); | 93 await _refreshInvalidatedFiles(); |
94 | 94 |
95 // Ensure that the graph starting at the entry point is ready. | 95 // Ensure that the graph starting at the entry point is ready. |
96 FileState entryLibrary = | 96 FileState entryLibrary = |
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
326 /// TODO(scheglov) Use API signatures. | 326 /// TODO(scheglov) Use API signatures. |
327 /// TODO(scheglov) Or use tree shaking and compute signatures of outlines. | 327 /// TODO(scheglov) Or use tree shaking and compute signatures of outlines. |
328 final String signature; | 328 final String signature; |
329 | 329 |
330 /// Kernel libraries for libraries in the [cycle]. Bodies of dependencies | 330 /// Kernel libraries for libraries in the [cycle]. Bodies of dependencies |
331 /// are not included, but but references to those dependencies are included. | 331 /// are not included, but but references to those dependencies are included. |
332 final List<Library> kernelLibraries; | 332 final List<Library> kernelLibraries; |
333 | 333 |
334 _LibraryCycleResult(this.cycle, this.signature, this.kernelLibraries); | 334 _LibraryCycleResult(this.cycle, this.signature, this.kernelLibraries); |
335 } | 335 } |
OLD | NEW |