| OLD | NEW |
| 1 library dart2js.cps_ir.finalize; | 1 library dart2js.cps_ir.finalize; |
| 2 | 2 |
| 3 import '../js/js.dart' as js; |
| 4 import '../js_backend/backend_helpers.dart'; |
| 5 import '../js_backend/js_backend.dart' show JavaScriptBackend; |
| 6 import 'cps_fragment.dart'; |
| 3 import 'cps_ir_nodes.dart'; | 7 import 'cps_ir_nodes.dart'; |
| 4 import 'cps_fragment.dart'; | |
| 5 import 'optimizers.dart' show Pass; | 8 import 'optimizers.dart' show Pass; |
| 6 import '../js_backend/js_backend.dart' show JavaScriptBackend; | |
| 7 import '../js_backend/backend_helpers.dart'; | |
| 8 import '../js/js.dart' as js; | |
| 9 | 9 |
| 10 /// A transformation pass that must run immediately before the tree IR builder. | 10 /// A transformation pass that must run immediately before the tree IR builder. |
| 11 /// | 11 /// |
| 12 /// This expands [BoundsCheck] nodes into more low-level operations. | 12 /// This expands [BoundsCheck] nodes into more low-level operations. |
| 13 class Finalize extends TrampolineRecursiveVisitor implements Pass { | 13 class Finalize extends TrampolineRecursiveVisitor implements Pass { |
| 14 String get passName => 'Finalize'; | 14 String get passName => 'Finalize'; |
| 15 | 15 |
| 16 JavaScriptBackend backend; | 16 JavaScriptBackend backend; |
| 17 BackendHelpers get helpers => backend.helpers; | 17 BackendHelpers get helpers => backend.helpers; |
| 18 | 18 |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 99 // when the refined type is an array type. Some optimizations assume the | 99 // when the refined type is an array type. Some optimizations assume the |
| 100 // type of an object is immutable, but the type of an array can change | 100 // type of an object is immutable, but the type of an array can change |
| 101 // after allocation. After the finalize pass, this assumption is no | 101 // after allocation. After the finalize pass, this assumption is no |
| 102 // longer needed, so we can replace the remaining idenitity templates. | 102 // longer needed, so we can replace the remaining idenitity templates. |
| 103 Refinement refinement = new Refinement(node.argument(0), node.type) | 103 Refinement refinement = new Refinement(node.argument(0), node.type) |
| 104 ..type = node.type; | 104 ..type = node.type; |
| 105 node.replaceWith(refinement); | 105 node.replaceWith(refinement); |
| 106 } | 106 } |
| 107 } | 107 } |
| 108 } | 108 } |
| OLD | NEW |