| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, 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 tree_ir_builder; | 5 library tree_ir_builder; |
| 6 | 6 |
| 7 import '../dart2jslib.dart' as dart2js; | 7 import '../dart2jslib.dart' as dart2js; |
| 8 import '../dart_types.dart'; | 8 import '../dart_types.dart'; |
| 9 import '../elements/elements.dart'; | 9 import '../elements/elements.dart'; |
| 10 import '../cps_ir/cps_ir_nodes.dart' as cps_ir; | 10 import '../cps_ir/cps_ir_nodes.dart' as cps_ir; |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 108 } | 108 } |
| 109 ++variable.readCount; | 109 ++variable.readCount; |
| 110 return variable; | 110 return variable; |
| 111 } | 111 } |
| 112 | 112 |
| 113 ExecutableDefinition build(cps_ir.ExecutableDefinition node) { | 113 ExecutableDefinition build(cps_ir.ExecutableDefinition node) { |
| 114 if (node is cps_ir.FieldDefinition) { | 114 if (node is cps_ir.FieldDefinition) { |
| 115 return buildField(node); | 115 return buildField(node); |
| 116 } else { | 116 } else { |
| 117 assert(dart2js.invariant( | 117 assert(dart2js.invariant( |
| 118 currentElement, | 118 CURRENT_ELEMENT_SPANNABLE, |
| 119 node is cps_ir.FunctionDefinition, | 119 node is cps_ir.FunctionDefinition, |
| 120 message: 'expected FunctionDefinition or FieldDefinition, ' | 120 message: 'expected FunctionDefinition or FieldDefinition, ' |
| 121 ' found $node')); | 121 ' found $node')); |
| 122 return buildFunction(node); | 122 return buildFunction(node); |
| 123 } | 123 } |
| 124 return null; | 124 return null; |
| 125 } | 125 } |
| 126 | 126 |
| 127 FieldDefinition buildField(cps_ir.FieldDefinition node) { | 127 FieldDefinition buildField(cps_ir.FieldDefinition node) { |
| 128 Statement body; | 128 Statement body; |
| (...skipping 415 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 544 // visited. | 544 // visited. |
| 545 internalError(CURRENT_ELEMENT_SPANNABLE, 'Unexpected IR node: $node.'); | 545 internalError(CURRENT_ELEMENT_SPANNABLE, 'Unexpected IR node: $node.'); |
| 546 return null; | 546 return null; |
| 547 } | 547 } |
| 548 | 548 |
| 549 Expression visitIsTrue(cps_ir.IsTrue node) { | 549 Expression visitIsTrue(cps_ir.IsTrue node) { |
| 550 return getVariableReference(node.value); | 550 return getVariableReference(node.value); |
| 551 } | 551 } |
| 552 } | 552 } |
| 553 | 553 |
| OLD | NEW |