| 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 cps_ir.cps_fragment; | 5 library cps_ir.cps_fragment; |
| 6 | 6 |
| 7 import '../constants/values.dart'; |
| 8 import '../elements/elements.dart'; |
| 9 import '../io/source_information.dart'; |
| 10 import '../types/types.dart' show TypeMask; |
| 11 import '../universe/selector.dart' show Selector; |
| 7 import 'cps_ir_nodes.dart'; | 12 import 'cps_ir_nodes.dart'; |
| 8 import '../constants/values.dart'; | |
| 9 import '../universe/selector.dart' show Selector; | |
| 10 import '../types/types.dart' show TypeMask; | |
| 11 import '../io/source_information.dart'; | |
| 12 import '../elements/elements.dart'; | |
| 13 | 13 |
| 14 /// Builds a CPS fragment that can be plugged into another CPS term. | 14 /// Builds a CPS fragment that can be plugged into another CPS term. |
| 15 /// | 15 /// |
| 16 /// A CPS fragment contains a CPS term, possibly with a "hole" in it denoting | 16 /// A CPS fragment contains a CPS term, possibly with a "hole" in it denoting |
| 17 /// where to insert new IR nodes. We say a fragment is "open" if it has such | 17 /// where to insert new IR nodes. We say a fragment is "open" if it has such |
| 18 /// a hole. Otherwise, the fragment is "closed" and cannot be extended further. | 18 /// a hole. Otherwise, the fragment is "closed" and cannot be extended further. |
| 19 /// | 19 /// |
| 20 /// This class is designed for building non-trivial CPS terms in a readable and | 20 /// This class is designed for building non-trivial CPS terms in a readable and |
| 21 /// non-error prone manner. It is not designed to manipulate existing IR nodes, | 21 /// non-error prone manner. It is not designed to manipulate existing IR nodes, |
| 22 /// nor is it intended to shield the user from every complexity in the IR. | 22 /// nor is it intended to shield the user from every complexity in the IR. |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 365 while (prim.firstRef != null) { | 365 while (prim.firstRef != null) { |
| 366 Refinement refine = prim.firstRef.parent; | 366 Refinement refine = prim.firstRef.parent; |
| 367 destroyRefinementsOfDeadPrimitive(refine); | 367 destroyRefinementsOfDeadPrimitive(refine); |
| 368 LetPrim letPrim = refine.parent; | 368 LetPrim letPrim = refine.parent; |
| 369 InteriorNode parent = letPrim.parent; | 369 InteriorNode parent = letPrim.parent; |
| 370 parent.body = letPrim.body; | 370 parent.body = letPrim.body; |
| 371 letPrim.body.parent = parent; | 371 letPrim.body.parent = parent; |
| 372 prim.firstRef.unlink(); | 372 prim.firstRef.unlink(); |
| 373 } | 373 } |
| 374 } | 374 } |
| OLD | NEW |