| 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 '../elements/elements.dart'; | 8 import '../elements/elements.dart'; |
| 9 import '../cps_ir/cps_ir_nodes.dart' as cps_ir; | 9 import '../cps_ir/cps_ir_nodes.dart' as cps_ir; |
| 10 import 'tree_ir_nodes.dart'; | 10 import 'tree_ir_nodes.dart'; |
| (...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 402 thenStatement = | 402 thenStatement = |
| 403 cont.hasExactlyOneUse ? visit(cont.body) : new Break(labels[cont]); | 403 cont.hasExactlyOneUse ? visit(cont.body) : new Break(labels[cont]); |
| 404 cont = node.falseContinuation.definition; | 404 cont = node.falseContinuation.definition; |
| 405 assert(cont.parameters.isEmpty); | 405 assert(cont.parameters.isEmpty); |
| 406 elseStatement = | 406 elseStatement = |
| 407 cont.hasExactlyOneUse ? visit(cont.body) : new Break(labels[cont]); | 407 cont.hasExactlyOneUse ? visit(cont.body) : new Break(labels[cont]); |
| 408 return new If(condition, thenStatement, elseStatement); | 408 return new If(condition, thenStatement, elseStatement); |
| 409 } | 409 } |
| 410 | 410 |
| 411 Expression visitConstant(cps_ir.Constant node) { | 411 Expression visitConstant(cps_ir.Constant node) { |
| 412 return new Constant(node.expression, node.value); | 412 return new Constant(node.expression); |
| 413 } | 413 } |
| 414 | 414 |
| 415 Expression visitThis(cps_ir.This node) { | 415 Expression visitThis(cps_ir.This node) { |
| 416 return new This(); | 416 return new This(); |
| 417 } | 417 } |
| 418 | 418 |
| 419 Expression visitReifyTypeVar(cps_ir.ReifyTypeVar node) { | 419 Expression visitReifyTypeVar(cps_ir.ReifyTypeVar node) { |
| 420 return new ReifyTypeVar(node.typeVariable); | 420 return new ReifyTypeVar(node.typeVariable); |
| 421 } | 421 } |
| 422 | 422 |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 // visited. | 462 // visited. |
| 463 compiler.internalError(compiler.currentElement, 'Unexpected IR node.'); | 463 compiler.internalError(compiler.currentElement, 'Unexpected IR node.'); |
| 464 return null; | 464 return null; |
| 465 } | 465 } |
| 466 | 466 |
| 467 Expression visitIsTrue(cps_ir.IsTrue node) { | 467 Expression visitIsTrue(cps_ir.IsTrue node) { |
| 468 return getVariableReference(node.value); | 468 return getVariableReference(node.value); |
| 469 } | 469 } |
| 470 } | 470 } |
| 471 | 471 |
| OLD | NEW |