| OLD | NEW |
| 1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 library dart2js.cps_ir.path_based_optimizer; | 4 library dart2js.cps_ir.path_based_optimizer; |
| 5 | 5 |
| 6 import 'cps_ir_nodes.dart'; | 6 import 'cps_ir_nodes.dart'; |
| 7 import 'optimizers.dart'; | 7 import 'optimizers.dart'; |
| 8 import 'cps_fragment.dart'; | 8 import 'cps_fragment.dart'; |
| 9 import '../js_backend/js_backend.dart'; | 9 import '../js_backend/js_backend.dart'; |
| 10 import '../constants/values.dart'; | 10 import '../constants/values.dart'; |
| 11 import '../elements/elements.dart'; | |
| 12 import '../universe/selector.dart'; | |
| 13 import '../types/types.dart'; | |
| 14 import 'type_mask_system.dart'; | 11 import 'type_mask_system.dart'; |
| 15 | 12 |
| 16 /// Optimizations based on intraprocedural forward dataflow analysis, taking | 13 /// Optimizations based on intraprocedural forward dataflow analysis, taking |
| 17 /// into account path information that is not expressed by [Refinement] nodes. | 14 /// into account path information that is not expressed by [Refinement] nodes. |
| 18 /// | 15 /// |
| 19 /// --- | 16 /// --- |
| 20 /// | 17 /// |
| 21 /// Removes branches that branch on the same value as a previously seen branch. | 18 /// Removes branches that branch on the same value as a previously seen branch. |
| 22 /// For example: | 19 /// For example: |
| 23 /// | 20 /// |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 175 node.selector)) { | 172 node.selector)) { |
| 176 Constant dummy = new Constant(new IntConstantValue(0)) | 173 Constant dummy = new Constant(new IntConstantValue(0)) |
| 177 ..type = typeSystem.intType; | 174 ..type = typeSystem.intType; |
| 178 new LetPrim(dummy).insertAbove(node.parent); | 175 new LetPrim(dummy).insertAbove(node.parent); |
| 179 node.argumentRefs[0].changeTo(dummy); | 176 node.argumentRefs[0].changeTo(dummy); |
| 180 node.callingConvention = CallingConvention.DummyIntercepted; | 177 node.callingConvention = CallingConvention.DummyIntercepted; |
| 181 } | 178 } |
| 182 } | 179 } |
| 183 } | 180 } |
| 184 } | 181 } |
| OLD | NEW |