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 623 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 node.dartType, | 634 node.dartType, |
635 node.arguments.map(getVariableUse).toList()); | 635 node.arguments.map(getVariableUse).toList()); |
636 } | 636 } |
637 | 637 |
638 Expression visitTypeTest(cps_ir.TypeTest node) { | 638 Expression visitTypeTest(cps_ir.TypeTest node) { |
639 Expression value = getVariableUse(node.value); | 639 Expression value = getVariableUse(node.value); |
640 List<Expression> typeArgs = translateArguments(node.typeArguments); | 640 List<Expression> typeArgs = translateArguments(node.typeArguments); |
641 return new TypeOperator(value, node.dartType, typeArgs, isTypeTest: true); | 641 return new TypeOperator(value, node.dartType, typeArgs, isTypeTest: true); |
642 } | 642 } |
643 | 643 |
644 Expression visitTypeTestViaFlag(cps_ir.TypeTestViaFlag node) { | |
645 Expression value = getVariableUse(node.interceptor); | |
646 // TODO(sra): Move !! to cps_ir level. | |
647 return new Not(new Not(new GetTypeTestProperty(value, node.dartType))); | |
648 } | |
649 | |
650 Expression visitGetStatic(cps_ir.GetStatic node) { | 644 Expression visitGetStatic(cps_ir.GetStatic node) { |
651 return new GetStatic(node.element, node.sourceInformation); | 645 return new GetStatic(node.element, node.sourceInformation); |
652 } | 646 } |
653 | 647 |
654 Expression visitSetStatic(cps_ir.SetStatic node) { | 648 Expression visitSetStatic(cps_ir.SetStatic node) { |
655 return new SetStatic( | 649 return new SetStatic( |
656 node.element, | 650 node.element, |
657 getVariableUse(node.value), | 651 getVariableUse(node.value), |
658 node.sourceInformation); | 652 node.sourceInformation); |
659 } | 653 } |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
699 internalError(CURRENT_ELEMENT_SPANNABLE, 'Unexpected IR node: $node'); | 693 internalError(CURRENT_ELEMENT_SPANNABLE, 'Unexpected IR node: $node'); |
700 } | 694 } |
701 | 695 |
702 visitFunctionDefinition(cps_ir.FunctionDefinition node) { | 696 visitFunctionDefinition(cps_ir.FunctionDefinition node) { |
703 unexpectedNode(node); | 697 unexpectedNode(node); |
704 } | 698 } |
705 visitParameter(cps_ir.Parameter node) => unexpectedNode(node); | 699 visitParameter(cps_ir.Parameter node) => unexpectedNode(node); |
706 visitContinuation(cps_ir.Continuation node) => unexpectedNode(node); | 700 visitContinuation(cps_ir.Continuation node) => unexpectedNode(node); |
707 visitMutableVariable(cps_ir.MutableVariable node) => unexpectedNode(node); | 701 visitMutableVariable(cps_ir.MutableVariable node) => unexpectedNode(node); |
708 } | 702 } |
| 703 |
OLD | NEW |