| OLD | NEW |
| 1 library dart2js.unsugar_cps; | 1 library dart2js.unsugar_cps; |
| 2 | 2 |
| 3 import '../../cps_ir/cps_ir_nodes.dart'; | 3 import '../../cps_ir/cps_ir_nodes.dart'; |
| 4 | 4 |
| 5 // TODO(karlklose): share the [ParentVisitor]. | 5 // TODO(karlklose): share the [ParentVisitor]. |
| 6 import '../../cps_ir/optimizers.dart'; | 6 import '../../cps_ir/optimizers.dart'; |
| 7 import '../../constants/expressions.dart'; | 7 import '../../constants/expressions.dart'; |
| 8 import '../../constants/values.dart'; | 8 import '../../constants/values.dart'; |
| 9 import '../../elements/elements.dart' | 9 import '../../elements/elements.dart' |
| 10 show ClassElement, FieldElement, FunctionElement, Element; | 10 show ClassElement, FieldElement, FunctionElement, Element; |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 Expression node) { | 62 Expression node) { |
| 63 InteriorNode parent = node.parent; | 63 InteriorNode parent = node.parent; |
| 64 Continuation continuation = new Continuation([result]); | 64 Continuation continuation = new Continuation([result]); |
| 65 continuation.body = node; | 65 continuation.body = node; |
| 66 _parentVisitor.processContinuation(continuation); | 66 _parentVisitor.processContinuation(continuation); |
| 67 | 67 |
| 68 Selector selector = new Selector.fromElement(function); | 68 Selector selector = new Selector.fromElement(function); |
| 69 // TODO(johnniwinther): Come up with an implementation of SourceInformation | 69 // TODO(johnniwinther): Come up with an implementation of SourceInformation |
| 70 // for calls such as this one that don't appear in the original source. | 70 // for calls such as this one that don't appear in the original source. |
| 71 InvokeStatic invoke = | 71 InvokeStatic invoke = |
| 72 new InvokeStatic(function, selector, continuation, arguments, null); | 72 new InvokeStatic(function, selector, arguments, continuation, null); |
| 73 _parentVisitor.processInvokeStatic(invoke); | 73 _parentVisitor.processInvokeStatic(invoke); |
| 74 | 74 |
| 75 LetCont letCont = new LetCont(continuation, invoke); | 75 LetCont letCont = new LetCont(continuation, invoke); |
| 76 _parentVisitor.processLetCont(letCont); | 76 _parentVisitor.processLetCont(letCont); |
| 77 | 77 |
| 78 parent.body = letCont; | 78 parent.body = letCont; |
| 79 letCont.parent = parent; | 79 letCont.parent = parent; |
| 80 } | 80 } |
| 81 | 81 |
| 82 processLetHandler(LetHandler node) { | 82 processLetHandler(LetHandler node) { |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 148 new LetPrim(i, | 148 new LetPrim(i, |
| 149 new Branch(new IsTrue(i), | 149 new Branch(new IsTrue(i), |
| 150 node.trueContinuation.definition, | 150 node.trueContinuation.definition, |
| 151 node.falseContinuation.definition))); | 151 node.falseContinuation.definition))); |
| 152 condition.value.unlink(); | 152 condition.value.unlink(); |
| 153 node.trueContinuation.unlink(); | 153 node.trueContinuation.unlink(); |
| 154 node.falseContinuation.unlink(); | 154 node.falseContinuation.unlink(); |
| 155 parent.body = newNode; | 155 parent.body = newNode; |
| 156 } | 156 } |
| 157 } | 157 } |
| OLD | NEW |