| 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' show | 9 import '../../elements/elements.dart' show |
| 10 ClassElement, | 10 ClassElement, |
| 11 FieldElement, | 11 FieldElement, |
| 12 FunctionElement, | 12 FunctionElement, |
| 13 Local, | 13 Local, |
| 14 ExecutableElement; | 14 ExecutableElement; |
| 15 import '../../js_backend/codegen/glue.dart'; | 15 import '../../js_backend/codegen/glue.dart'; |
| 16 import '../../dart2jslib.dart' show Selector, World; | 16 import '../../dart2jslib.dart' show Selector, World; |
| 17 import '../../cps_ir/cps_ir_builder.dart' show ThisParameterLocal; |
| 17 | 18 |
| 18 class ExplicitReceiverParameterEntity implements Local { | 19 class ExplicitReceiverParameterEntity implements Local { |
| 19 String get name => 'receiver'; | 20 String get name => 'receiver'; |
| 20 final ExecutableElement executableContext; | 21 final ExecutableElement executableContext; |
| 21 ExplicitReceiverParameterEntity(this.executableContext); | 22 ExplicitReceiverParameterEntity(this.executableContext); |
| 22 toString() => 'ExplicitReceiverParameterEntity($executableContext)'; | 23 toString() => 'ExplicitReceiverParameterEntity($executableContext)'; |
| 23 } | 24 } |
| 24 | 25 |
| 25 /// Rewrites the initial CPS IR to make Dart semantics explicit and inserts | 26 /// Rewrites the initial CPS IR to make Dart semantics explicit and inserts |
| 26 /// special nodes that respect JavaScript behavior. | 27 /// special nodes that respect JavaScript behavior. |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 285 new LetPrim(i, | 286 new LetPrim(i, |
| 286 new Branch(new IsTrue(i), | 287 new Branch(new IsTrue(i), |
| 287 node.trueContinuation.definition, | 288 node.trueContinuation.definition, |
| 288 node.falseContinuation.definition))); | 289 node.falseContinuation.definition))); |
| 289 condition.value.unlink(); | 290 condition.value.unlink(); |
| 290 node.trueContinuation.unlink(); | 291 node.trueContinuation.unlink(); |
| 291 node.falseContinuation.unlink(); | 292 node.falseContinuation.unlink(); |
| 292 parent.body = newNode; | 293 parent.body = newNode; |
| 293 } | 294 } |
| 294 } | 295 } |
| OLD | NEW |