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

Unified Diff: pkg/compiler/lib/src/js_backend/backend.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/js_backend/backend.dart
diff --git a/pkg/compiler/lib/src/js_backend/backend.dart b/pkg/compiler/lib/src/js_backend/backend.dart
index c5d2014ec5c7fb68960c575142c4612656785779..c2ba50ca05f97c8092cfef4aba4e921047c60e9d 100644
--- a/pkg/compiler/lib/src/js_backend/backend.dart
+++ b/pkg/compiler/lib/src/js_backend/backend.dart
@@ -974,13 +974,12 @@ class JavaScriptBackend extends Backend {
Iterable<MixinApplicationElement> uses = classWorld.mixinUsesOf(mixin);
Set<ClassElement> result = null;
for (MixinApplicationElement use in uses) {
- Iterable<ClassElement> subclasses = classWorld.strictSubclassesOf(use);
- for (ClassElement subclass in subclasses) {
+ classWorld.forEachStrictSubclassOf(use, (ClassElement subclass) {
if (isNativeOrExtendsNative(subclass)) {
if (result == null) result = new Set<ClassElement>();
result.add(subclass);
}
- }
+ });
}
return result;
}
@@ -2196,7 +2195,7 @@ class JavaScriptBackend extends Backend {
});
// 4) all overriding members of subclasses/subtypes (should be resolved)
if (compiler.world.hasAnyStrictSubtype(cls)) {
- for (ClassElement subcls in compiler.world.strictSubtypesOf(cls)) {
+ compiler.world.forEachStrictSubtypeOf(cls, (ClassElement subcls) {
subcls.forEachClassMember((Member member) {
if (memberNames.contains(member.name)) {
// TODO(20993): find out why this assertion fails.
@@ -2207,7 +2206,7 @@ class JavaScriptBackend extends Backend {
}
}
});
- }
+ });
}
// 5) all its closures
List<LocalFunctionElement> closures = closureMap[cls];

Powered by Google App Engine
This is Rietveld 408576698