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 value = getVariableUse(node.value); | 514 Expression receiver = getVariableUse(node.receiver); |
515 List<Expression> typeArgs = translateArguments(node.typeArguments); | |
516 Expression concat = | 515 Expression concat = |
517 new TypeOperator(value, node.type, typeArgs, | 516 new TypeOperator(receiver, node.type, isTypeTest: node.isTypeTest); |
518 isTypeTest: node.isTypeTest); | |
519 return continueWithExpression(node.continuation, concat); | 517 return continueWithExpression(node.continuation, concat); |
520 } | 518 } |
521 | 519 |
522 Statement visitInvokeConstructor(cps_ir.InvokeConstructor node) { | 520 Statement visitInvokeConstructor(cps_ir.InvokeConstructor node) { |
523 List<Expression> arguments = translateArguments(node.arguments); | 521 List<Expression> arguments = translateArguments(node.arguments); |
524 Expression invoke = new InvokeConstructor( | 522 Expression invoke = new InvokeConstructor( |
525 node.type, | 523 node.type, |
526 node.target, | 524 node.target, |
527 node.selector, | 525 node.selector, |
528 arguments); | 526 arguments); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 | 675 |
678 Statement visitSetStatic(cps_ir.SetStatic node) { | 676 Statement visitSetStatic(cps_ir.SetStatic node) { |
679 SetStatic setStatic = new SetStatic( | 677 SetStatic setStatic = new SetStatic( |
680 node.element, | 678 node.element, |
681 getVariableUse(node.value), | 679 getVariableUse(node.value), |
682 node.sourceInformation); | 680 node.sourceInformation); |
683 return new ExpressionStatement(setStatic, visit(node.body)); | 681 return new ExpressionStatement(setStatic, visit(node.body)); |
684 } | 682 } |
685 } | 683 } |
686 | 684 |
OLD | NEW |