| 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 library dart2js.cps_ir.scalar_replacement; | 4 library dart2js.cps_ir.scalar_replacement; |
| 5 | 5 |
| 6 import 'optimizers.dart'; | |
| 7 | |
| 8 import 'dart:collection' show Queue; | 6 import 'dart:collection' show Queue; |
| 9 | 7 |
| 10 import '../common.dart'; | 8 import '../common.dart'; |
| 11 import '../compiler.dart' as dart2js show Compiler; | 9 import '../compiler.dart' as dart2js show Compiler; |
| 12 import '../constants/values.dart'; | 10 import '../constants/values.dart'; |
| 13 import '../elements/elements.dart'; | 11 import '../elements/elements.dart'; |
| 14 import '../types/types.dart'; | 12 import '../types/types.dart'; |
| 15 import '../world.dart' show World; | 13 import '../world.dart' show World; |
| 16 import 'cps_ir_nodes.dart'; | 14 import 'cps_ir_nodes.dart'; |
| 15 import 'optimizers.dart'; |
| 17 | 16 |
| 18 /** | 17 /** |
| 19 * Replaces aggregates with a set of local values. Performs inlining of | 18 * Replaces aggregates with a set of local values. Performs inlining of |
| 20 * single-use closures to generate more replaceable aggregates. | 19 * single-use closures to generate more replaceable aggregates. |
| 21 */ | 20 */ |
| 22 class ScalarReplacer extends Pass { | 21 class ScalarReplacer extends Pass { |
| 23 String get passName => 'Scalar replacement'; | 22 String get passName => 'Scalar replacement'; |
| 24 | 23 |
| 25 final InternalErrorFunction _internalError; | 24 final InternalErrorFunction _internalError; |
| 26 final World _classWorld; | 25 final World _classWorld; |
| (...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 215 class ScalarReplacementRemovalVisitor extends TrampolineRecursiveVisitor { | 214 class ScalarReplacementRemovalVisitor extends TrampolineRecursiveVisitor { |
| 216 ScalarReplacementVisitor process; | 215 ScalarReplacementVisitor process; |
| 217 | 216 |
| 218 ScalarReplacementRemovalVisitor(this.process); | 217 ScalarReplacementRemovalVisitor(this.process); |
| 219 | 218 |
| 220 processReference(Reference reference) { | 219 processReference(Reference reference) { |
| 221 process.reconsider(reference.definition); | 220 process.reconsider(reference.definition); |
| 222 reference.unlink(); | 221 reference.unlink(); |
| 223 } | 222 } |
| 224 } | 223 } |
| OLD | NEW |