Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(114)

Unified Diff: pkg/kernel/lib/class_hierarchy.dart

Issue 2924333002: Use ClassHierarchy.applyChanges() in MixinFullResolution. (Closed)
Patch Set: Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/kernel/lib/src/incremental_class_hierarchy.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/kernel/lib/class_hierarchy.dart
diff --git a/pkg/kernel/lib/class_hierarchy.dart b/pkg/kernel/lib/class_hierarchy.dart
index c17bd8c11d07424108ab78050ccfb0801f790249..b0ce1064b22df6c8ec3b02f5b02199096dbde27e 100644
--- a/pkg/kernel/lib/class_hierarchy.dart
+++ b/pkg/kernel/lib/class_hierarchy.dart
@@ -120,10 +120,19 @@ abstract class ClassHierarchy {
/// parameter determines which type of access is being overridden.
void forEachOverridePair(Class class_,
callback(Member declaredMember, Member interfaceMember, bool isSetter));
+
+ /// This method is invoked by the client after it changed the [changed]
+ /// classes, and some of the information that this hierarchy might have
+ /// cached, is not valid anymore. The hierarchy may perform required
+ /// updates and return the same instance, or return a new instance.
+ ClassHierarchy applyChanges(Iterable<Class> changed);
ahe 2017/06/08 20:18:10 I suggest that you rename this parameter to classe
scheglov 2017/06/08 21:00:25 Done.
}
/// Implementation of [ClassHierarchy] for closed world.
class ClosedWorldClassHierarchy implements ClassHierarchy {
+ /// The [Program] that this class hierarchy represents.
+ final Program program;
ahe 2017/06/08 20:18:10 Private?
scheglov 2017/06/08 21:00:24 Done.
+
/// All classes in the program.
///
/// The list is ordered so that classes occur after their super classes.
@@ -447,7 +456,13 @@ class ClosedWorldClassHierarchy implements ClassHierarchy {
return new ClassSet(this, _infoFor[class_].subclassIntervalList);
}
- ClosedWorldClassHierarchy._internal(Program program, int numberOfClasses)
+ @override
+ ClassHierarchy applyChanges(Iterable<Class> changed) {
+ if (changed.isEmpty) return this;
+ return new ClosedWorldClassHierarchy(program);
+ }
+
+ ClosedWorldClassHierarchy._internal(this.program, int numberOfClasses)
: classes = new List<Class>(numberOfClasses) {
// Build the class ordering based on a topological sort.
for (var library in program.libraries) {
« no previous file with comments | « no previous file | pkg/kernel/lib/src/incremental_class_hierarchy.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698