| 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 501 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 512 | 512 |
| 513 Statement visitTypeOperator(cps_ir.TypeOperator node) { | 513 Statement visitTypeOperator(cps_ir.TypeOperator node) { |
| 514 Expression receiver = getVariableUse(node.receiver); | 514 Expression receiver = getVariableUse(node.receiver); |
| 515 Expression concat = | 515 Expression concat = |
| 516 new TypeOperator(receiver, node.type, isTypeTest: node.isTypeTest); | 516 new TypeOperator(receiver, node.type, isTypeTest: node.isTypeTest); |
| 517 return continueWithExpression(node.continuation, concat); | 517 return continueWithExpression(node.continuation, concat); |
| 518 } | 518 } |
| 519 | 519 |
| 520 Statement visitInvokeConstructor(cps_ir.InvokeConstructor node) { | 520 Statement visitInvokeConstructor(cps_ir.InvokeConstructor node) { |
| 521 List<Expression> arguments = translateArguments(node.arguments); | 521 List<Expression> arguments = translateArguments(node.arguments); |
| 522 Expression invoke = | 522 Expression invoke = new InvokeConstructor( |
| 523 new InvokeConstructor(node.type, node.target, node.selector, arguments); | 523 node.type, |
| 524 node.target, |
| 525 node.selector, |
| 526 arguments); |
| 524 return continueWithExpression(node.continuation, invoke); | 527 return continueWithExpression(node.continuation, invoke); |
| 525 } | 528 } |
| 526 | 529 |
| 527 Statement visitInvokeContinuation(cps_ir.InvokeContinuation node) { | 530 Statement visitInvokeContinuation(cps_ir.InvokeContinuation node) { |
| 528 // Invocations of the return continuation are translated to returns. | 531 // Invocations of the return continuation are translated to returns. |
| 529 // Other continuation invocations are replaced with assignments of the | 532 // Other continuation invocations are replaced with assignments of the |
| 530 // arguments to formal parameter variables, followed by the body if | 533 // arguments to formal parameter variables, followed by the body if |
| 531 // the continuation is singly reference or a break if it is multiply | 534 // the continuation is singly reference or a break if it is multiply |
| 532 // referenced. | 535 // referenced. |
| 533 cps_ir.Continuation cont = node.continuation.definition; | 536 cps_ir.Continuation cont = node.continuation.definition; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 644 return getVariableUse(node.value); | 647 return getVariableUse(node.value); |
| 645 } | 648 } |
| 646 | 649 |
| 647 Expression visitReifyRuntimeType(cps_ir.ReifyRuntimeType node) { | 650 Expression visitReifyRuntimeType(cps_ir.ReifyRuntimeType node) { |
| 648 return new ReifyRuntimeType(getVariableUse(node.value)); | 651 return new ReifyRuntimeType(getVariableUse(node.value)); |
| 649 } | 652 } |
| 650 | 653 |
| 651 Expression visitReadTypeVariable(cps_ir.ReadTypeVariable node) { | 654 Expression visitReadTypeVariable(cps_ir.ReadTypeVariable node) { |
| 652 return new ReadTypeVariable(node.variable, getVariableUse(node.target)); | 655 return new ReadTypeVariable(node.variable, getVariableUse(node.target)); |
| 653 } | 656 } |
| 657 |
| 658 @override |
| 659 Node visitTypeExpression(cps_ir.TypeExpression node) { |
| 660 return new TypeExpression( |
| 661 node.dartType, |
| 662 node.arguments.map(getVariableUse).toList()); |
| 663 } |
| 654 } | 664 } |
| OLD | NEW |