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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/js_backend/backend.dart

Issue 14286007: Revert "Native mixin interceptor bug fix" (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 7 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | tests/compiler/dart2js_extra/10216a_test.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 typedef void Recompile(Element element); 7 typedef void Recompile(Element element);
8 8
9 class ReturnInfo { 9 class ReturnInfo {
10 HType returnType; 10 HType returnType;
(...skipping 827 matching lines...) Expand 10 before | Expand all | Expand 10 after
838 */ 838 */
839 Set<ClassElement> getInterceptedClassesOn(SourceString name) { 839 Set<ClassElement> getInterceptedClassesOn(SourceString name) {
840 Set<Element> intercepted = interceptedElements[name]; 840 Set<Element> intercepted = interceptedElements[name];
841 if (intercepted == null) return null; 841 if (intercepted == null) return null;
842 return interceptedClassesCache.putIfAbsent(name, () { 842 return interceptedClassesCache.putIfAbsent(name, () {
843 // Populate the cache by running through all the elements and 843 // Populate the cache by running through all the elements and
844 // determine if the given selector applies to them. 844 // determine if the given selector applies to them.
845 Set<ClassElement> result = new Set<ClassElement>(); 845 Set<ClassElement> result = new Set<ClassElement>();
846 for (Element element in intercepted) { 846 for (Element element in intercepted) {
847 ClassElement classElement = element.getEnclosingClass(); 847 ClassElement classElement = element.getEnclosingClass();
848 if (classElement.isNative() 848 result.add(classElement);
849 || interceptedClasses.contains(classElement)) {
850 result.add(classElement);
851 }
852 if (classesMixedIntoNativeClasses.contains(classElement)) {
853 Set<Element> nativeSubclasses = nativeSubclassesOfMixin(classElement);
854 if (nativeSubclasses != null) result.addAll(nativeSubclasses);
855 }
856 } 849 }
857 return result; 850 return result;
858 }); 851 });
859 } 852 }
860 853
861 Set<Element> nativeSubclassesOfMixin(ClassElement mixin) {
862 Set<MixinApplicationElement> uses = compiler.world.mixinUses[mixin];
863 if (uses == null) return null;
864 Set<Element> result = null;
865 for (MixinApplicationElement use in uses) {
866 Iterable<ClassElement> subclasses = compiler.world.subclasses[use];
867 if (subclasses != null) {
868 for (ClassElement subclass in subclasses) {
869 if (subclass.isNative()) {
870 if (result == null) result = new Set<Element>();
871 result.add(subclass);
872 }
873 }
874 }
875 }
876 return result;
877 }
878
879 bool operatorEqHandlesNullArgument(FunctionElement operatorEqfunction) { 854 bool operatorEqHandlesNullArgument(FunctionElement operatorEqfunction) {
880 return specialOperatorEqClasses.contains( 855 return specialOperatorEqClasses.contains(
881 operatorEqfunction.getEnclosingClass()); 856 operatorEqfunction.getEnclosingClass());
882 } 857 }
883 858
884 void initializeHelperClasses() { 859 void initializeHelperClasses() {
885 getInterceptorMethod = 860 getInterceptorMethod =
886 compiler.findInterceptor(const SourceString('getInterceptor')); 861 compiler.findInterceptor(const SourceString('getInterceptor'));
887 interceptedNames = 862 interceptedNames =
888 compiler.findInterceptor(const SourceString('interceptedNames')); 863 compiler.findInterceptor(const SourceString('interceptedNames'));
(...skipping 922 matching lines...) Expand 10 before | Expand all | Expand 10 after
1811 ClassElement get constListImplementation => jsArrayClass; 1786 ClassElement get constListImplementation => jsArrayClass;
1812 ClassElement get fixedListImplementation => jsFixedArrayClass; 1787 ClassElement get fixedListImplementation => jsFixedArrayClass;
1813 ClassElement get growableListImplementation => jsExtendableArrayClass; 1788 ClassElement get growableListImplementation => jsExtendableArrayClass;
1814 ClassElement get mapImplementation => mapLiteralClass; 1789 ClassElement get mapImplementation => mapLiteralClass;
1815 ClassElement get constMapImplementation => constMapLiteralClass; 1790 ClassElement get constMapImplementation => constMapLiteralClass;
1816 ClassElement get functionImplementation => jsFunctionClass; 1791 ClassElement get functionImplementation => jsFunctionClass;
1817 ClassElement get typeImplementation => typeLiteralClass; 1792 ClassElement get typeImplementation => typeLiteralClass;
1818 ClassElement get boolImplementation => jsBoolClass; 1793 ClassElement get boolImplementation => jsBoolClass;
1819 ClassElement get nullImplementation => jsNullClass; 1794 ClassElement get nullImplementation => jsNullClass;
1820 } 1795 }
OLDNEW
« no previous file with comments | « no previous file | tests/compiler/dart2js_extra/10216a_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698