| 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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 396 return continueWithExpression(node.continuation, invoke); | 396 return continueWithExpression(node.continuation, invoke); |
| 397 } | 397 } |
| 398 | 398 |
| 399 Statement visitInvokeMethod(cps_ir.InvokeMethod node) { | 399 Statement visitInvokeMethod(cps_ir.InvokeMethod node) { |
| 400 Expression invoke = new InvokeMethod(getVariableReference(node.receiver), | 400 Expression invoke = new InvokeMethod(getVariableReference(node.receiver), |
| 401 node.selector, | 401 node.selector, |
| 402 translateArguments(node.arguments)); | 402 translateArguments(node.arguments)); |
| 403 return continueWithExpression(node.continuation, invoke); | 403 return continueWithExpression(node.continuation, invoke); |
| 404 } | 404 } |
| 405 | 405 |
| 406 Statement visitInvokeSuperMethod(cps_ir.InvokeSuperMethod node) { | 406 Statement visitInvokeMethodDirectly(cps_ir.InvokeMethodDirectly node) { |
| 407 Expression receiver = getVariableReference(node.receiver); |
| 407 List<Expression> arguments = translateArguments(node.arguments); | 408 List<Expression> arguments = translateArguments(node.arguments); |
| 408 Expression invoke = new InvokeSuperMethod(node.selector, arguments); | 409 Expression invoke = new InvokeMethodDirectly(receiver, node.target, |
| 410 node.selector, arguments); |
| 409 return continueWithExpression(node.continuation, invoke); | 411 return continueWithExpression(node.continuation, invoke); |
| 410 } | 412 } |
| 411 | 413 |
| 412 Statement visitConcatenateStrings(cps_ir.ConcatenateStrings node) { | 414 Statement visitConcatenateStrings(cps_ir.ConcatenateStrings node) { |
| 413 List<Expression> arguments = translateArguments(node.arguments); | 415 List<Expression> arguments = translateArguments(node.arguments); |
| 414 Expression concat = new ConcatenateStrings(arguments); | 416 Expression concat = new ConcatenateStrings(arguments); |
| 415 return continueWithExpression(node.continuation, concat); | 417 return continueWithExpression(node.continuation, concat); |
| 416 } | 418 } |
| 417 | 419 |
| 418 Statement continueWithExpression(cps_ir.Reference continuation, | 420 Statement continueWithExpression(cps_ir.Reference continuation, |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 570 // visited. | 572 // visited. |
| 571 internalError(CURRENT_ELEMENT_SPANNABLE, 'Unexpected IR node: $node.'); | 573 internalError(CURRENT_ELEMENT_SPANNABLE, 'Unexpected IR node: $node.'); |
| 572 return null; | 574 return null; |
| 573 } | 575 } |
| 574 | 576 |
| 575 Expression visitIsTrue(cps_ir.IsTrue node) { | 577 Expression visitIsTrue(cps_ir.IsTrue node) { |
| 576 return getVariableReference(node.value); | 578 return getVariableReference(node.value); |
| 577 } | 579 } |
| 578 } | 580 } |
| 579 | 581 |
| OLD | NEW |