| 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 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 } | 589 } |
| 590 | 590 |
| 591 /// The `process` methods below do not insert the referenced arguments into | 591 /// The `process` methods below do not insert the referenced arguments into |
| 592 /// the vector, but instead rely on them being inserted here. | 592 /// the vector, but instead rely on them being inserted here. |
| 593 processReference(Reference ref) { | 593 processReference(Reference ref) { |
| 594 if (vector == null) return; | 594 if (vector == null) return; |
| 595 Primitive prim = ref.definition.effectiveDefinition; | 595 Primitive prim = ref.definition.effectiveDefinition; |
| 596 vector.add(gvnFor[prim] ?? prim); | 596 vector.add(gvnFor[prim] ?? prim); |
| 597 } | 597 } |
| 598 | 598 |
| 599 visitTypeTest(TypeTest node) { | 599 processTypeTest(TypeTest node) { |
| 600 vector = [GvnCode.TYPE_TEST, node.dartType]; | 600 vector = [GvnCode.TYPE_TEST, node.dartType]; |
| 601 processReference(node.value); | |
| 602 node.typeArguments.forEach(processReference); | |
| 603 // Suppress processing of the interceptor argument. | |
| 604 } | 601 } |
| 605 | 602 |
| 606 processTypeTestViaFlag(TypeTestViaFlag node) { | 603 processTypeTestViaFlag(TypeTestViaFlag node) { |
| 607 vector = [GvnCode.TYPE_TEST_VIA_FLAG, node.dartType]; | 604 vector = [GvnCode.TYPE_TEST_VIA_FLAG, node.dartType]; |
| 608 } | 605 } |
| 609 | 606 |
| 610 processApplyBuiltinOperator(ApplyBuiltinOperator node) { | 607 processApplyBuiltinOperator(ApplyBuiltinOperator node) { |
| 611 vector = [GvnCode.BUILTIN_OPERATOR, node.operator.index]; | 608 vector = [GvnCode.BUILTIN_OPERATOR, node.operator.index]; |
| 612 } | 609 } |
| 613 | 610 |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 700 | 697 |
| 701 @override | 698 @override |
| 702 processReference(Reference ref) { | 699 processReference(Reference ref) { |
| 703 callback(ref); | 700 callback(ref); |
| 704 } | 701 } |
| 705 | 702 |
| 706 static void forEach(Primitive node, ReferenceCallback callback) { | 703 static void forEach(Primitive node, ReferenceCallback callback) { |
| 707 new InputVisitor(callback).visit(node); | 704 new InputVisitor(callback).visit(node); |
| 708 } | 705 } |
| 709 } | 706 } |
| OLD | NEW |