| 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 693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 704 // TODO(asgerf): This is a placeholder until we agree on how to track | 704 // TODO(asgerf): This is a placeholder until we agree on how to track |
| 705 // side effects. | 705 // side effects. |
| 706 bool objectIsNotNull = false; | 706 bool objectIsNotNull = false; |
| 707 | 707 |
| 708 GetField(Primitive object, this.field) | 708 GetField(Primitive object, this.field) |
| 709 : this.object = new Reference<Primitive>(object); | 709 : this.object = new Reference<Primitive>(object); |
| 710 | 710 |
| 711 accept(Visitor visitor) => visitor.visitGetField(this); | 711 accept(Visitor visitor) => visitor.visitGetField(this); |
| 712 | 712 |
| 713 bool get isSafeForElimination => objectIsNotNull; | 713 bool get isSafeForElimination => objectIsNotNull; |
| 714 bool get isSafeForReordering => objectIsNotNull && field.isFinal; | 714 bool get isSafeForReordering => false; |
| 715 } | 715 } |
| 716 | 716 |
| 717 /// Get the length of a string or native list. | 717 /// Get the length of a string or native list. |
| 718 class GetLength extends Primitive { | 718 class GetLength extends Primitive { |
| 719 final Reference<Primitive> object; | 719 final Reference<Primitive> object; |
| 720 | 720 |
| 721 /// True if the object is known not to be null. | 721 /// True if the object is known not to be null. |
| 722 bool objectIsNotNull = false; | 722 bool objectIsNotNull = false; |
| 723 | 723 |
| 724 GetLength(Primitive object) : this.object = new Reference<Primitive>(object); | 724 GetLength(Primitive object) : this.object = new Reference<Primitive>(object); |
| (...skipping 900 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1625 /// Visit a just-deleted subterm and unlink all [Reference]s in it. | 1625 /// Visit a just-deleted subterm and unlink all [Reference]s in it. |
| 1626 class RemovalVisitor extends RecursiveVisitor { | 1626 class RemovalVisitor extends RecursiveVisitor { |
| 1627 processReference(Reference reference) { | 1627 processReference(Reference reference) { |
| 1628 reference.unlink(); | 1628 reference.unlink(); |
| 1629 } | 1629 } |
| 1630 | 1630 |
| 1631 static void remove(Node node) { | 1631 static void remove(Node node) { |
| 1632 (new RemovalVisitor()).visit(node); | 1632 (new RemovalVisitor()).visit(node); |
| 1633 } | 1633 } |
| 1634 } | 1634 } |
| OLD | NEW |