| OLD | NEW |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2015, 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.cps_ir.gvn; | 5 library dart2js.cps_ir.gvn; |
| 6 | 6 |
| 7 import 'cps_ir_nodes.dart'; | 7 import 'cps_ir_nodes.dart'; |
| 8 import '../universe/side_effects.dart'; | 8 import '../universe/side_effects.dart'; |
| 9 import '../elements/elements.dart'; | 9 import '../elements/elements.dart'; |
| 10 import 'optimizers.dart' show Pass; | 10 import 'optimizers.dart' show Pass; |
| (...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 722 | 722 |
| 723 processReifyRuntimeType(ReifyRuntimeType node) { | 723 processReifyRuntimeType(ReifyRuntimeType node) { |
| 724 vector = [GvnCode.REIFY_RUNTIME_TYPE]; | 724 vector = [GvnCode.REIFY_RUNTIME_TYPE]; |
| 725 } | 725 } |
| 726 | 726 |
| 727 processReadTypeVariable(ReadTypeVariable node) { | 727 processReadTypeVariable(ReadTypeVariable node) { |
| 728 vector = [GvnCode.READ_TYPE_VARIABLE, node.variable]; | 728 vector = [GvnCode.READ_TYPE_VARIABLE, node.variable]; |
| 729 } | 729 } |
| 730 | 730 |
| 731 processTypeExpression(TypeExpression node) { | 731 processTypeExpression(TypeExpression node) { |
| 732 vector = [GvnCode.TYPE_EXPRESSION, node.dartType]; | 732 if (node.isForInstance) { |
| 733 vector = [GvnCode.TYPE_EXPRESSION, null]; // dartType unused. |
| 734 } else { |
| 735 vector = [GvnCode.TYPE_EXPRESSION, node.dartType]; |
| 736 } |
| 733 } | 737 } |
| 734 | 738 |
| 735 processInterceptor(Interceptor node) { | 739 processInterceptor(Interceptor node) { |
| 736 vector = [GvnCode.INTERCEPTOR]; | 740 vector = [GvnCode.INTERCEPTOR]; |
| 737 } | 741 } |
| 738 } | 742 } |
| 739 | 743 |
| 740 class GvnCode { | 744 class GvnCode { |
| 741 static const int TYPE_TEST = 1; | 745 static const int TYPE_TEST = 1; |
| 742 static const int TYPE_TEST_VIA_FLAG = 2; | 746 static const int TYPE_TEST_VIA_FLAG = 2; |
| (...skipping 17 matching lines...) Expand all Loading... |
| 760 | 764 |
| 761 @override | 765 @override |
| 762 processReference(Reference ref) { | 766 processReference(Reference ref) { |
| 763 callback(ref); | 767 callback(ref); |
| 764 } | 768 } |
| 765 | 769 |
| 766 static void forEach(Primitive node, ReferenceCallback callback) { | 770 static void forEach(Primitive node, ReferenceCallback callback) { |
| 767 new InputVisitor(callback).visit(node); | 771 new InputVisitor(callback).visit(node); |
| 768 } | 772 } |
| 769 } | 773 } |
| OLD | NEW |