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 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
397 current = | 397 current = |
398 new LabeledStatement(label, current, visit(continuation.body)); | 398 new LabeledStatement(label, current, visit(continuation.body)); |
399 } | 399 } |
400 } | 400 } |
401 return current; | 401 return current; |
402 } | 402 } |
403 | 403 |
404 Statement visitInvokeStatic(cps_ir.InvokeStatic node) { | 404 Statement visitInvokeStatic(cps_ir.InvokeStatic node) { |
405 // Calls are translated to direct style. | 405 // Calls are translated to direct style. |
406 List<Expression> arguments = translateArguments(node.arguments); | 406 List<Expression> arguments = translateArguments(node.arguments); |
407 Expression invoke = new InvokeStatic(node.target, node.selector, arguments); | 407 Expression invoke = new InvokeStatic(node.target, node.selector, arguments, |
| 408 sourceInformation: node.sourceInformation); |
408 return continueWithExpression(node.continuation, invoke); | 409 return continueWithExpression(node.continuation, invoke); |
409 } | 410 } |
410 | 411 |
411 Statement visitInvokeMethod(cps_ir.InvokeMethod node) { | 412 Statement visitInvokeMethod(cps_ir.InvokeMethod node) { |
412 Expression invoke = new InvokeMethod(getVariableReference(node.receiver), | 413 Expression invoke = new InvokeMethod(getVariableReference(node.receiver), |
413 node.selector, | 414 node.selector, |
414 translateArguments(node.arguments)); | 415 translateArguments(node.arguments)); |
415 return continueWithExpression(node.continuation, invoke); | 416 return continueWithExpression(node.continuation, invoke); |
416 } | 417 } |
417 | 418 |
(...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 // visited. | 590 // visited. |
590 internalError(CURRENT_ELEMENT_SPANNABLE, 'Unexpected IR node: $node.'); | 591 internalError(CURRENT_ELEMENT_SPANNABLE, 'Unexpected IR node: $node.'); |
591 return null; | 592 return null; |
592 } | 593 } |
593 | 594 |
594 Expression visitIsTrue(cps_ir.IsTrue node) { | 595 Expression visitIsTrue(cps_ir.IsTrue node) { |
595 return getVariableReference(node.value); | 596 return getVariableReference(node.value); |
596 } | 597 } |
597 } | 598 } |
598 | 599 |
OLD | NEW |