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 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
483 thenStatement = | 483 thenStatement = |
484 cont.hasExactlyOneUse ? visit(cont.body) : new Break(labels[cont]); | 484 cont.hasExactlyOneUse ? visit(cont.body) : new Break(labels[cont]); |
485 cont = node.falseContinuation.definition; | 485 cont = node.falseContinuation.definition; |
486 assert(cont.parameters.isEmpty); | 486 assert(cont.parameters.isEmpty); |
487 elseStatement = | 487 elseStatement = |
488 cont.hasExactlyOneUse ? visit(cont.body) : new Break(labels[cont]); | 488 cont.hasExactlyOneUse ? visit(cont.body) : new Break(labels[cont]); |
489 return new If(condition, thenStatement, elseStatement); | 489 return new If(condition, thenStatement, elseStatement); |
490 } | 490 } |
491 | 491 |
492 Expression visitConstant(cps_ir.Constant node) { | 492 Expression visitConstant(cps_ir.Constant node) { |
493 return new Constant(node.expression); | 493 return new Constant(node.expression, node.value); |
494 } | 494 } |
495 | 495 |
496 Expression visitLiteralList(cps_ir.LiteralList node) { | 496 Expression visitLiteralList(cps_ir.LiteralList node) { |
497 return new LiteralList( | 497 return new LiteralList( |
498 node.type, | 498 node.type, |
499 translateArguments(node.values)); | 499 translateArguments(node.values)); |
500 } | 500 } |
501 | 501 |
502 Expression visitLiteralMap(cps_ir.LiteralMap node) { | 502 Expression visitLiteralMap(cps_ir.LiteralMap node) { |
503 return new LiteralMap( | 503 return new LiteralMap( |
(...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 | 571 |
572 Statement visitSetStatic(cps_ir.SetStatic node) { | 572 Statement visitSetStatic(cps_ir.SetStatic node) { |
573 SetStatic setStatic = new SetStatic( | 573 SetStatic setStatic = new SetStatic( |
574 node.element, | 574 node.element, |
575 getVariableUse(node.value), | 575 getVariableUse(node.value), |
576 node.sourceInformation); | 576 node.sourceInformation); |
577 return new ExpressionStatement(setStatic, visit(node.body)); | 577 return new ExpressionStatement(setStatic, visit(node.body)); |
578 } | 578 } |
579 } | 579 } |
580 | 580 |
OLD | NEW |