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

Side by Side Diff: pkg/compiler/lib/src/js_backend/backend.dart

Issue 1224753002: Remove ClassWorld.subclassesOf and ClassWorld.subtypesOf. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 5 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of js_backend; 5 part of js_backend;
6 6
7 const VERBOSE_OPTIMIZER_HINTS = false; 7 const VERBOSE_OPTIMIZER_HINTS = false;
8 8
9 class JavaScriptItemCompilationContext extends ItemCompilationContext { 9 class JavaScriptItemCompilationContext extends ItemCompilationContext {
10 final Set<HInstruction> boundsChecked = new Set<HInstruction>(); 10 final Set<HInstruction> boundsChecked = new Set<HInstruction>();
(...skipping 832 matching lines...) Expand 10 before | Expand all | Expand 10 after
843 } 843 }
844 return result; 844 return result;
845 }); 845 });
846 } 846 }
847 847
848 Set<ClassElement> nativeSubclassesOfMixin(ClassElement mixin) { 848 Set<ClassElement> nativeSubclassesOfMixin(ClassElement mixin) {
849 ClassWorld classWorld = compiler.world; 849 ClassWorld classWorld = compiler.world;
850 Iterable<MixinApplicationElement> uses = classWorld.mixinUsesOf(mixin); 850 Iterable<MixinApplicationElement> uses = classWorld.mixinUsesOf(mixin);
851 Set<ClassElement> result = null; 851 Set<ClassElement> result = null;
852 for (MixinApplicationElement use in uses) { 852 for (MixinApplicationElement use in uses) {
853 Iterable<ClassElement> subclasses = classWorld.subclassesOf(use); 853 Iterable<ClassElement> subclasses = classWorld.strictSubclassesOf(use);
854 for (ClassElement subclass in subclasses) { 854 for (ClassElement subclass in subclasses) {
855 if (Elements.isNativeOrExtendsNative(subclass)) { 855 if (Elements.isNativeOrExtendsNative(subclass)) {
856 if (result == null) result = new Set<ClassElement>(); 856 if (result == null) result = new Set<ClassElement>();
857 result.add(subclass); 857 result.add(subclass);
858 } 858 }
859 } 859 }
860 } 860 }
861 return result; 861 return result;
862 } 862 }
863 863
(...skipping 1462 matching lines...) Expand 10 before | Expand all | Expand 10 after
2326 } 2326 }
2327 }); 2327 });
2328 // 3) all members, including fields via getter/setters (if resolved) 2328 // 3) all members, including fields via getter/setters (if resolved)
2329 cls.forEachClassMember((Member member) { 2329 cls.forEachClassMember((Member member) {
2330 if (resolution.hasBeenResolved(member.element)) { 2330 if (resolution.hasBeenResolved(member.element)) {
2331 memberNames.add(member.name); 2331 memberNames.add(member.name);
2332 reflectableMembers.add(member.element); 2332 reflectableMembers.add(member.element);
2333 } 2333 }
2334 }); 2334 });
2335 // 4) all overriding members of subclasses/subtypes (should be resolved) 2335 // 4) all overriding members of subclasses/subtypes (should be resolved)
2336 if (compiler.world.hasAnySubtype(cls)) { 2336 if (compiler.world.hasAnyStrictSubtype(cls)) {
2337 for (ClassElement subcls in compiler.world.subtypesOf(cls)) { 2337 for (ClassElement subcls in compiler.world.strictSubtypesOf(cls)) {
2338 subcls.forEachClassMember((Member member) { 2338 subcls.forEachClassMember((Member member) {
2339 if (memberNames.contains(member.name)) { 2339 if (memberNames.contains(member.name)) {
2340 // TODO(20993): find out why this assertion fails. 2340 // TODO(20993): find out why this assertion fails.
2341 // assert(invariant(member.element, 2341 // assert(invariant(member.element,
2342 // resolution.hasBeenResolved(member.element))); 2342 // resolution.hasBeenResolved(member.element)));
2343 if (resolution.hasBeenResolved(member.element)) { 2343 if (resolution.hasBeenResolved(member.element)) {
2344 reflectableMembers.add(member.element); 2344 reflectableMembers.add(member.element);
2345 } 2345 }
2346 } 2346 }
2347 }); 2347 });
(...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after
3005 } 3005 }
3006 } 3006 }
3007 3007
3008 /// Records that [constant] is used by the element behind [registry]. 3008 /// Records that [constant] is used by the element behind [registry].
3009 class Dependency { 3009 class Dependency {
3010 final ConstantValue constant; 3010 final ConstantValue constant;
3011 final Element annotatedElement; 3011 final Element annotatedElement;
3012 3012
3013 const Dependency(this.constant, this.annotatedElement); 3013 const Dependency(this.constant, this.annotatedElement);
3014 } 3014 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/inferrer/concrete_types_inferrer.dart ('k') | pkg/compiler/lib/src/js_backend/runtime_types.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698