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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/ssa/optimize.dart

Issue 13685022: Make mixins work on native classes. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 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 | Annotate | Revision Log
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 ssa; 5 part of ssa;
6 6
7 abstract class OptimizationPhase { 7 abstract class OptimizationPhase {
8 String get name; 8 String get name;
9 void visitGraph(HGraph graph); 9 void visitGraph(HGraph graph);
10 } 10 }
(...skipping 797 matching lines...) Expand 10 before | Expand all | Expand 10 after
808 return false; 808 return false;
809 } 809 }
810 810
811 // [interceptedClasses] is sparse - it is just the classes that define some 811 // [interceptedClasses] is sparse - it is just the classes that define some
812 // intercepted method. Their subclasses (that inherit the method) are 812 // intercepted method. Their subclasses (that inherit the method) are
813 // implicit, so we have to extend them. 813 // implicit, so we have to extend them.
814 814
815 TypeMask receiverMask = receiverType.computeMask(compiler); 815 TypeMask receiverMask = receiverType.computeMask(compiler);
816 return interceptedClasses 816 return interceptedClasses
817 .where((cls) => cls != compiler.objectClass) 817 .where((cls) => cls != compiler.objectClass)
818 .map((cls) => new TypeMask.subclass(cls.rawType)) 818 .map((cls) => backend.classesMixedIntoNativeClasses.contains(cls)
819 ? new TypeMask.subtype(cls.rawType)
820 : new TypeMask.subclass(cls.rawType))
819 .every((mask) => receiverMask.intersection(mask, compiler).isEmpty); 821 .every((mask) => receiverMask.intersection(mask, compiler).isEmpty);
820 } 822 }
821 823
822 HInstruction tryComputeConstantInterceptor(HInstruction input, 824 HInstruction tryComputeConstantInterceptor(HInstruction input,
823 Set<ClassElement> intercepted) { 825 Set<ClassElement> intercepted) {
824 if (input == graph.explicitReceiverParameter) { 826 if (input == graph.explicitReceiverParameter) {
825 // If `explicitReceiverParameter` is set it means the current method is an 827 // If `explicitReceiverParameter` is set it means the current method is an
826 // interceptor method, and `this` is the interceptor. The caller just did 828 // interceptor method, and `this` is the interceptor. The caller just did
827 // `getInterceptor(foo).currentMethod(foo)` to enter the current method. 829 // `getInterceptor(foo).currentMethod(foo)` to enter the current method.
828 return graph.thisInstruction; 830 return graph.thisInstruction;
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after
1686 HBasicBlock block = user.block; 1688 HBasicBlock block = user.block;
1687 block.addAfter(user, interceptor); 1689 block.addAfter(user, interceptor);
1688 block.rewrite(user, interceptor); 1690 block.rewrite(user, interceptor);
1689 block.remove(user); 1691 block.remove(user);
1690 1692
1691 // The interceptor will be removed in the dead code elimination 1693 // The interceptor will be removed in the dead code elimination
1692 // phase. Note that removing it here would not work because of how 1694 // phase. Note that removing it here would not work because of how
1693 // the [visitBasicBlock] is implemented. 1695 // the [visitBasicBlock] is implemented.
1694 } 1696 }
1695 } 1697 }
OLDNEW
« no previous file with comments | « sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart ('k') | tests/compiler/dart2js_native/dart2js_native.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698