| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 library fasta.source_loader; | 5 library fasta.source_loader; |
| 6 | 6 |
| 7 import 'dart:async' show Future; | 7 import 'dart:async' show Future; |
| 8 | 8 |
| 9 import 'dart:typed_data' show Uint8List; | 9 import 'dart:typed_data' show Uint8List; |
| 10 | 10 |
| (...skipping 373 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 } | 384 } |
| 385 | 385 |
| 386 /// Performs the first phase of top level initializer inference, which | 386 /// Performs the first phase of top level initializer inference, which |
| 387 /// consists of creating kernel objects for all fields and top level variables | 387 /// consists of creating kernel objects for all fields and top level variables |
| 388 /// that might be subject to type inference, and records dependencies between | 388 /// that might be subject to type inference, and records dependencies between |
| 389 /// them. | 389 /// them. |
| 390 void prepareInitializerInference() { | 390 void prepareInitializerInference() { |
| 391 typeInferenceEngine.prepareTopLevel(coreTypes, hierarchy); | 391 typeInferenceEngine.prepareTopLevel(coreTypes, hierarchy); |
| 392 builders.forEach((Uri uri, LibraryBuilder library) { | 392 builders.forEach((Uri uri, LibraryBuilder library) { |
| 393 if (library is SourceLibraryBuilder) { | 393 if (library is SourceLibraryBuilder) { |
| 394 library.prepareInitializerInference(typeInferenceEngine, library, null); | 394 library.prepareInitializerInference(library, null); |
| 395 } | 395 } |
| 396 }); | 396 }); |
| 397 ticker.logMs("Prepared initializer inference"); | 397 ticker.logMs("Prepared initializer inference"); |
| 398 } | 398 } |
| 399 | 399 |
| 400 /// Performs the second phase of top level initializer inference, which is to | 400 /// Performs the second phase of top level initializer inference, which is to |
| 401 /// visit fields and top level variables in topologically-sorted order and | 401 /// visit fields and top level variables in topologically-sorted order and |
| 402 /// assign their types. | 402 /// assign their types. |
| 403 void performInitializerInference() { | 403 void performInitializerInference() { |
| 404 typeInferenceEngine.finishTopLevel(); | 404 typeInferenceEngine.finishTopLevel(); |
| 405 ticker.logMs("Performed initializer inference"); | 405 ticker.logMs("Performed initializer inference"); |
| 406 } | 406 } |
| 407 | 407 |
| 408 List<Uri> getDependencies() => sourceBytes.keys.toList(); | 408 List<Uri> getDependencies() => sourceBytes.keys.toList(); |
| 409 } | 409 } |
| OLD | NEW |