Chromium Code Reviews| 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/src/base/processed_options.dart'; | 7 import 'package:front_end/src/base/processed_options.dart'; |
| 8 import 'package:front_end/src/incremental_kernel_generator_impl.dart'; | 8 import 'package:front_end/src/incremental_kernel_generator_impl.dart'; |
| 9 import 'package:kernel/kernel.dart'; | 9 import 'package:kernel/kernel.dart'; |
| 10 | 10 |
| 11 import 'compiler_options.dart'; | 11 import 'compiler_options.dart'; |
| 12 | 12 |
| 13 /// Represents the difference between "old" and "new" states of a program. | 13 /// Represents the difference between "old" and "new" states of a program. |
| 14 /// | 14 /// |
| 15 /// Not intended to be implemented or extended by clients. | 15 /// Not intended to be implemented or extended by clients. |
| 16 class DeltaProgram { | 16 class DeltaProgram { |
| 17 /// The new state of the program. | 17 /// The new state of the program. |
| 18 /// | 18 /// |
| 19 /// Libraries whose kernel representation is known to be unchanged since the | 19 /// It includes full kernels for changed libraries and for libraries that |
| 20 /// last [DeltaProgram] are not included. | 20 /// are affected by the transitive change of API in the changed libraries. |
| 21 final Map<Uri, Program> newState; | 21 /// |
| 22 /// For VM reload purposes we need to provide also full kernels for the | |
| 23 /// libraries that are transitively imported by the library with `main()` | |
| 24 /// and transitively import a changed library. | |
| 25 /// TODO(scheglov) With `main()` or entry point URI? | |
|
Siggi Cherem (dart-lang)
2017/05/08 22:49:36
for the purpose of the implementation here - anyth
| |
| 26 /// | |
| 27 /// Also includes outlines for the transitive closure of libraries that are | |
|
Siggi Cherem (dart-lang)
2017/05/08 22:49:36
Using the terminology from earlier today, I'd reph
| |
| 28 /// referenced by previously specified changed, affected or VM-required | |
| 29 /// libraries. | |
| 30 final Program newProgram; | |
| 22 | 31 |
| 23 DeltaProgram(this.newState); | 32 DeltaProgram(this.newProgram); |
|
Siggi Cherem (dart-lang)
2017/05/08 22:49:36
Let's add a TODO saying that [Program] will become
| |
| 24 | 33 |
| 25 /// TODO(paulberry): add information about libraries that were removed. | 34 /// TODO(paulberry): add information about libraries that were removed. |
| 26 } | 35 } |
| 27 | 36 |
| 28 /// Interface for generating an initial kernel representation of a program and | 37 /// Interface for generating an initial kernel representation of a program and |
| 29 /// keeping it up to date as incremental changes are made. | 38 /// keeping it up to date as incremental changes are made. |
| 30 /// | 39 /// |
| 31 /// This class maintains an internal "previous program state"; each | 40 /// This class maintains an internal "previous program state"; each |
| 32 /// time [computeDelta] is called, it updates the previous program state and | 41 /// time [computeDelta] is called, it updates the previous program state and |
| 33 /// produces a representation of what has changed. When there are few changes, | 42 /// produces a representation of what has changed. When there are few changes, |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 95 | 104 |
| 96 /// Remove all source files from the set of valid sources. This guarantees | 105 /// Remove all source files from the set of valid sources. This guarantees |
| 97 /// that all files will be re-read on the next call to [computeDelta]. | 106 /// that all files will be re-read on the next call to [computeDelta]. |
| 98 /// | 107 /// |
| 99 /// Note that this does not erase the previous program state; the next time | 108 /// Note that this does not erase the previous program state; the next time |
| 100 /// [computeDelta] is called, if parts of the program are discovered to be | 109 /// [computeDelta] is called, if parts of the program are discovered to be |
| 101 /// unchanged, parts of the previous program state will still be re-used to | 110 /// unchanged, parts of the previous program state will still be re-used to |
| 102 /// speed up compilation. | 111 /// speed up compilation. |
| 103 void invalidateAll(); | 112 void invalidateAll(); |
| 104 } | 113 } |
| OLD | NEW |