| 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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 | 104 |
| 105 assert(stackTraceParameter.hasNoUses); | 105 assert(stackTraceParameter.hasNoUses); |
| 106 node.handler.parameters.removeLast(); | 106 node.handler.parameters.removeLast(); |
| 107 } | 107 } |
| 108 | 108 |
| 109 processThrow(Throw node) { | 109 processThrow(Throw node) { |
| 110 // The subexpression of throw is wrapped in the JavaScript output. | 110 // The subexpression of throw is wrapped in the JavaScript output. |
| 111 Parameter value = new Parameter(null); | 111 Parameter value = new Parameter(null); |
| 112 insertStaticCall(_glue.getWrapExceptionHelper(), [node.value.definition], | 112 insertStaticCall(_glue.getWrapExceptionHelper(), [node.value.definition], |
| 113 value, node); | 113 value, node); |
| 114 node.value.unlink(); |
| 114 node.value = new Reference<Primitive>(value); | 115 node.value = new Reference<Primitive>(value); |
| 115 } | 116 } |
| 116 | 117 |
| 117 processInvokeMethod(InvokeMethod node) { | 118 processInvokeMethod(InvokeMethod node) { |
| 118 Selector selector = node.selector; | 119 Selector selector = node.selector; |
| 119 // TODO(karlklose): should we rewrite all selectors? | 120 // TODO(karlklose): should we rewrite all selectors? |
| 120 if (!_glue.isInterceptedSelector(selector)) return; | 121 if (!_glue.isInterceptedSelector(selector)) return; |
| 121 | 122 |
| 122 Primitive receiver = node.receiver.definition; | 123 Primitive receiver = node.receiver.definition; |
| 123 Set<ClassElement> interceptedClasses = | 124 Set<ClassElement> interceptedClasses = |
| (...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 new LetPrim(i, | 157 new LetPrim(i, |
| 157 new Branch(new IsTrue(i), | 158 new Branch(new IsTrue(i), |
| 158 node.trueContinuation.definition, | 159 node.trueContinuation.definition, |
| 159 node.falseContinuation.definition))); | 160 node.falseContinuation.definition))); |
| 160 condition.value.unlink(); | 161 condition.value.unlink(); |
| 161 node.trueContinuation.unlink(); | 162 node.trueContinuation.unlink(); |
| 162 node.falseContinuation.unlink(); | 163 node.falseContinuation.unlink(); |
| 163 parent.body = newNode; | 164 parent.body = newNode; |
| 164 } | 165 } |
| 165 } | 166 } |
| OLD | NEW |