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 493 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
504 return Assign.makeStatement(variable, value, visit(node.body)); | 504 return Assign.makeStatement(variable, value, visit(node.body)); |
505 } | 505 } |
506 | 506 |
507 Statement visitDeclareFunction(cps_ir.DeclareFunction node) { | 507 Statement visitDeclareFunction(cps_ir.DeclareFunction node) { |
508 Variable variable = addMutableVariable(node.variable); | 508 Variable variable = addMutableVariable(node.variable); |
509 FunctionDefinition function = makeSubFunction(node.definition); | 509 FunctionDefinition function = makeSubFunction(node.definition); |
510 return new FunctionDeclaration(variable, function, visit(node.body)); | 510 return new FunctionDeclaration(variable, function, visit(node.body)); |
511 } | 511 } |
512 | 512 |
513 Statement visitTypeOperator(cps_ir.TypeOperator node) { | 513 Statement visitTypeOperator(cps_ir.TypeOperator node) { |
514 Expression receiver = getVariableUse(node.receiver); | 514 Expression value = getVariableUse(node.value); |
| 515 List<Expression> typeArgs = translateArguments(node.typeArguments); |
515 Expression concat = | 516 Expression concat = |
516 new TypeOperator(receiver, node.type, isTypeTest: node.isTypeTest); | 517 new TypeOperator(value, node.type, typeArgs, |
| 518 isTypeTest: node.isTypeTest); |
517 return continueWithExpression(node.continuation, concat); | 519 return continueWithExpression(node.continuation, concat); |
518 } | 520 } |
519 | 521 |
520 Statement visitInvokeConstructor(cps_ir.InvokeConstructor node) { | 522 Statement visitInvokeConstructor(cps_ir.InvokeConstructor node) { |
521 List<Expression> arguments = translateArguments(node.arguments); | 523 List<Expression> arguments = translateArguments(node.arguments); |
522 Expression invoke = new InvokeConstructor( | 524 Expression invoke = new InvokeConstructor( |
523 node.type, | 525 node.type, |
524 node.target, | 526 node.target, |
525 node.selector, | 527 node.selector, |
526 arguments); | 528 arguments); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 | 677 |
676 Statement visitSetStatic(cps_ir.SetStatic node) { | 678 Statement visitSetStatic(cps_ir.SetStatic node) { |
677 SetStatic setStatic = new SetStatic( | 679 SetStatic setStatic = new SetStatic( |
678 node.element, | 680 node.element, |
679 getVariableUse(node.value), | 681 getVariableUse(node.value), |
680 node.sourceInformation); | 682 node.sourceInformation); |
681 return new ExpressionStatement(setStatic, visit(node.body)); | 683 return new ExpressionStatement(setStatic, visit(node.body)); |
682 } | 684 } |
683 } | 685 } |
684 | 686 |
OLD | NEW |