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

Side by Side Diff: pkg/compiler/lib/src/world.dart

Issue 2814453005: Merge CommonElements and BackendHelpers! (Closed)
Patch Set: comments and re-merge, take two Created 3 years, 8 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 library dart2js.world; 5 library dart2js.world;
6 6
7 import 'closure.dart' show ClosureClassElement, SynthesizedCallMethodElementX; 7 import 'closure.dart' show ClosureClassElement, SynthesizedCallMethodElementX;
8 import 'common/backend_api.dart' show BackendClasses; 8 import 'common/backend_api.dart' show BackendClasses;
9 import 'common.dart'; 9 import 'common.dart';
10 import 'constants/constant_system.dart'; 10 import 'constants/constant_system.dart';
(...skipping 699 matching lines...) Expand 10 before | Expand all | Expand 10 after
710 // Vacuously true. 710 // Vacuously true.
711 return true; 711 return true;
712 } 712 }
713 return classSet.hasOnlyInstantiatedSubclasses; 713 return classSet.hasOnlyInstantiatedSubclasses;
714 } 714 }
715 715
716 @override 716 @override
717 ClassElement getLubOfInstantiatedSubclasses(ClassElement cls) { 717 ClassElement getLubOfInstantiatedSubclasses(ClassElement cls) {
718 assert(isClosed); 718 assert(isClosed);
719 if (nativeData.isJsInteropClass(cls)) { 719 if (nativeData.isJsInteropClass(cls)) {
720 return _backend.helpers.jsJavaScriptObjectClass; 720 return commonElements.jsJavaScriptObjectClass;
721 } 721 }
722 ClassHierarchyNode hierarchy = _classHierarchyNodes[cls.declaration]; 722 ClassHierarchyNode hierarchy = _classHierarchyNodes[cls.declaration];
723 return hierarchy != null 723 return hierarchy != null
724 ? hierarchy.getLubOfInstantiatedSubclasses() 724 ? hierarchy.getLubOfInstantiatedSubclasses()
725 : null; 725 : null;
726 } 726 }
727 727
728 @override 728 @override
729 ClassElement getLubOfInstantiatedSubtypes(ClassElement cls) { 729 ClassElement getLubOfInstantiatedSubtypes(ClassElement cls) {
730 assert(isClosed); 730 assert(isClosed);
731 if (nativeData.isJsInteropClass(cls)) { 731 if (nativeData.isJsInteropClass(cls)) {
732 return _backend.helpers.jsJavaScriptObjectClass; 732 return commonElements.jsJavaScriptObjectClass;
733 } 733 }
734 ClassSet classSet = _classSets[cls.declaration]; 734 ClassSet classSet = _classSets[cls.declaration];
735 return classSet != null ? classSet.getLubOfInstantiatedSubtypes() : null; 735 return classSet != null ? classSet.getLubOfInstantiatedSubtypes() : null;
736 } 736 }
737 737
738 /// Returns an iterable over the common supertypes of the [classes]. 738 /// Returns an iterable over the common supertypes of the [classes].
739 Iterable<ClassElement> commonSupertypesOf(Iterable<ClassElement> classes) { 739 Iterable<ClassElement> commonSupertypesOf(Iterable<ClassElement> classes) {
740 assert(isClosed); 740 assert(isClosed);
741 Iterator<ClassElement> iterator = classes.iterator; 741 Iterator<ClassElement> iterator = classes.iterator;
742 if (!iterator.moveNext()) return const <ClassElement>[]; 742 if (!iterator.moveNext()) return const <ClassElement>[];
(...skipping 448 matching lines...) Expand 10 before | Expand all | Expand 10 after
1191 return getMightBePassedToApply(element.expression); 1191 return getMightBePassedToApply(element.expression);
1192 } 1192 }
1193 return functionsThatMightBePassedToApply.contains(element); 1193 return functionsThatMightBePassedToApply.contains(element);
1194 } 1194 }
1195 1195
1196 @override 1196 @override
1197 bool getCurrentlyKnownMightBePassedToApply(Element element) { 1197 bool getCurrentlyKnownMightBePassedToApply(Element element) {
1198 return getMightBePassedToApply(element); 1198 return getMightBePassedToApply(element);
1199 } 1199 }
1200 } 1200 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/ssa/value_range_analyzer.dart ('k') | tests/compiler/dart2js/jsinterop/world_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698