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 '../diagnostics/invariant.dart' show | 7 import '../diagnostics/invariant.dart' show |
8 InternalErrorFunction; | 8 InternalErrorFunction; |
9 import '../diagnostics/spannable.dart' show | 9 import '../diagnostics/spannable.dart' show |
10 CURRENT_ELEMENT_SPANNABLE; | 10 CURRENT_ELEMENT_SPANNABLE; |
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
633 } | 633 } |
634 | 634 |
635 Expression visitApplyBuiltinOperator(cps_ir.ApplyBuiltinOperator node) { | 635 Expression visitApplyBuiltinOperator(cps_ir.ApplyBuiltinOperator node) { |
636 if (node.operator == BuiltinOperator.IsFalsy) { | 636 if (node.operator == BuiltinOperator.IsFalsy) { |
637 return new Not(getVariableUse(node.arguments.single)); | 637 return new Not(getVariableUse(node.arguments.single)); |
638 } | 638 } |
639 return new ApplyBuiltinOperator(node.operator, | 639 return new ApplyBuiltinOperator(node.operator, |
640 translateArguments(node.arguments)); | 640 translateArguments(node.arguments)); |
641 } | 641 } |
642 | 642 |
| 643 Expression visitApplyBuiltinMethod(cps_ir.ApplyBuiltinMethod node) { |
| 644 return new ApplyBuiltinMethod(node.method, |
| 645 getVariableUse(node.receiver), |
| 646 translateArguments(node.arguments), |
| 647 receiverIsNotNull: node.receiverIsNotNull); |
| 648 } |
| 649 |
643 Expression visitGetLength(cps_ir.GetLength node) { | 650 Expression visitGetLength(cps_ir.GetLength node) { |
644 return new GetLength(getVariableUse(node.object)); | 651 return new GetLength(getVariableUse(node.object)); |
645 } | 652 } |
646 | 653 |
647 Expression visitGetIndex(cps_ir.GetIndex node) { | 654 Expression visitGetIndex(cps_ir.GetIndex node) { |
648 return new GetIndex(getVariableUse(node.object), | 655 return new GetIndex(getVariableUse(node.object), |
649 getVariableUse(node.index)); | 656 getVariableUse(node.index)); |
650 } | 657 } |
651 | 658 |
652 Expression visitSetIndex(cps_ir.SetIndex node) { | 659 Expression visitSetIndex(cps_ir.SetIndex node) { |
(...skipping 16 matching lines...) Expand all Loading... |
669 | 676 |
670 visitFunctionDefinition(cps_ir.FunctionDefinition node) { | 677 visitFunctionDefinition(cps_ir.FunctionDefinition node) { |
671 unexpectedNode(node); | 678 unexpectedNode(node); |
672 } | 679 } |
673 visitParameter(cps_ir.Parameter node) => unexpectedNode(node); | 680 visitParameter(cps_ir.Parameter node) => unexpectedNode(node); |
674 visitContinuation(cps_ir.Continuation node) => unexpectedNode(node); | 681 visitContinuation(cps_ir.Continuation node) => unexpectedNode(node); |
675 visitMutableVariable(cps_ir.MutableVariable node) => unexpectedNode(node); | 682 visitMutableVariable(cps_ir.MutableVariable node) => unexpectedNode(node); |
676 visitIsTrue(cps_ir.IsTrue node) => unexpectedNode(node); | 683 visitIsTrue(cps_ir.IsTrue node) => unexpectedNode(node); |
677 } | 684 } |
678 | 685 |
OLD | NEW |