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