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

Unified Diff: pkg/compiler/lib/src/types/union_type_mask.dart

Issue 1627333002: Optimize subclass/subtype queries (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Use strictSubtypeCount Created 4 years, 11 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
Index: pkg/compiler/lib/src/types/union_type_mask.dart
diff --git a/pkg/compiler/lib/src/types/union_type_mask.dart b/pkg/compiler/lib/src/types/union_type_mask.dart
index 6f8c81367584a09ac669ef49f8e5eebfb414dc86..61663499171b5bfdd9a94c4b7541b9a857f1bfd4 100644
--- a/pkg/compiler/lib/src/types/union_type_mask.dart
+++ b/pkg/compiler/lib/src/types/union_type_mask.dart
@@ -118,11 +118,11 @@ class UnionTypeMask implements TypeMask {
// TODO(sigmund, johnniwinther): computing length here (and below) is
// expensive. If we can't prevent `flatten` from being called a lot, it
// might be worth caching results.
- size = classWorld.strictSubclassesOf(candidate).length;
- assert(size <= classWorld.strictSubtypesOf(candidate).length);
+ size = classWorld.strictSubclassCount(candidate);
+ assert(size <= classWorld.strictSubtypeCount(candidate));
} else {
kind = FlatTypeMask.SUBTYPE;
- size = classWorld.strictSubtypesOf(candidate).length;
+ size = classWorld.strictSubtypeCount(candidate);
}
// Update the best candidate if the new one is better.
if (bestElement == null || size < bestSize) {

Powered by Google App Engine
This is Rietveld 408576698