OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 library dart2js.ir_nodes; | 4 library dart2js.ir_nodes; |
5 | 5 |
6 import '../constants/values.dart' as values show ConstantValue; | 6 import '../constants/values.dart' as values show ConstantValue; |
7 import '../dart_types.dart' show DartType, InterfaceType, TypeVariableType; | 7 import '../dart_types.dart' show DartType, InterfaceType, TypeVariableType; |
8 import '../elements/elements.dart'; | 8 import '../elements/elements.dart'; |
9 import '../io/source_information.dart' show SourceInformation; | 9 import '../io/source_information.dart' show SourceInformation; |
10 import '../types/types.dart' show TypeMask; | 10 import '../types/types.dart' show TypeMask; |
(...skipping 705 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
716 // side effects. | 716 // side effects. |
717 bool objectIsNotNull = false; | 717 bool objectIsNotNull = false; |
718 | 718 |
719 GetField(Primitive object, this.field) | 719 GetField(Primitive object, this.field) |
720 : this.object = new Reference<Primitive>(object); | 720 : this.object = new Reference<Primitive>(object); |
721 | 721 |
722 accept(Visitor visitor) => visitor.visitGetField(this); | 722 accept(Visitor visitor) => visitor.visitGetField(this); |
723 | 723 |
724 bool get isSafeForElimination => objectIsNotNull; | 724 bool get isSafeForElimination => objectIsNotNull; |
725 bool get isSafeForReordering => false; | 725 bool get isSafeForReordering => false; |
| 726 |
| 727 toString() => 'GetField($field)'; |
726 } | 728 } |
727 | 729 |
728 /// Get the length of a string or native list. | 730 /// Get the length of a string or native list. |
729 class GetLength extends Primitive { | 731 class GetLength extends Primitive { |
730 final Reference<Primitive> object; | 732 final Reference<Primitive> object; |
731 | 733 |
732 /// True if the object is known not to be null. | 734 /// True if the object is known not to be null. |
733 bool objectIsNotNull = false; | 735 bool objectIsNotNull = false; |
734 | 736 |
735 GetLength(Primitive object) : this.object = new Reference<Primitive>(object); | 737 GetLength(Primitive object) : this.object = new Reference<Primitive>(object); |
(...skipping 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
865 CreateInstance(this.classElement, List<Primitive> arguments, | 867 CreateInstance(this.classElement, List<Primitive> arguments, |
866 List<Primitive> typeInformation, | 868 List<Primitive> typeInformation, |
867 this.sourceInformation) | 869 this.sourceInformation) |
868 : this.arguments = _referenceList(arguments), | 870 : this.arguments = _referenceList(arguments), |
869 this.typeInformation = _referenceList(typeInformation); | 871 this.typeInformation = _referenceList(typeInformation); |
870 | 872 |
871 accept(Visitor visitor) => visitor.visitCreateInstance(this); | 873 accept(Visitor visitor) => visitor.visitCreateInstance(this); |
872 | 874 |
873 bool get isSafeForElimination => true; | 875 bool get isSafeForElimination => true; |
874 bool get isSafeForReordering => true; | 876 bool get isSafeForReordering => true; |
| 877 |
| 878 toString() => 'CreateInstance($classElement)'; |
875 } | 879 } |
876 | 880 |
877 class Interceptor extends Primitive { | 881 class Interceptor extends Primitive { |
878 final Reference<Primitive> input; | 882 final Reference<Primitive> input; |
879 final Set<ClassElement> interceptedClasses = new Set<ClassElement>(); | 883 final Set<ClassElement> interceptedClasses = new Set<ClassElement>(); |
880 final SourceInformation sourceInformation; | 884 final SourceInformation sourceInformation; |
881 | 885 |
882 Interceptor(Primitive input, this.sourceInformation) | 886 Interceptor(Primitive input, this.sourceInformation) |
883 : this.input = new Reference<Primitive>(input); | 887 : this.input = new Reference<Primitive>(input); |
884 | 888 |
(...skipping 739 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1624 /// Visit a just-deleted subterm and unlink all [Reference]s in it. | 1628 /// Visit a just-deleted subterm and unlink all [Reference]s in it. |
1625 class RemovalVisitor extends RecursiveVisitor { | 1629 class RemovalVisitor extends RecursiveVisitor { |
1626 processReference(Reference reference) { | 1630 processReference(Reference reference) { |
1627 reference.unlink(); | 1631 reference.unlink(); |
1628 } | 1632 } |
1629 | 1633 |
1630 static void remove(Node node) { | 1634 static void remove(Node node) { |
1631 (new RemovalVisitor()).visit(node); | 1635 (new RemovalVisitor()).visit(node); |
1632 } | 1636 } |
1633 } | 1637 } |
OLD | NEW |