| 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 'dart:collection'; | 6 import 'dart:collection'; |
| 7 import 'cps_fragment.dart' show CpsFragment; | 7 import 'cps_fragment.dart' show CpsFragment; |
| 8 import '../constants/values.dart' as values; | 8 import '../constants/values.dart' as values; |
| 9 import '../dart_types.dart' show DartType, InterfaceType, TypeVariableType; | 9 import '../dart_types.dart' show DartType, InterfaceType, TypeVariableType; |
| 10 import '../elements/elements.dart'; | 10 import '../elements/elements.dart'; |
| (...skipping 714 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 725 /// but need to reason about value references being identical (i.e. referring | 725 /// but need to reason about value references being identical (i.e. referring |
| 726 /// to the same primitive). | 726 /// to the same primitive). |
| 727 class Refinement extends Primitive { | 727 class Refinement extends Primitive { |
| 728 Reference<Primitive> value; | 728 Reference<Primitive> value; |
| 729 final TypeMask refineType; | 729 final TypeMask refineType; |
| 730 | 730 |
| 731 Refinement(Primitive value, this.refineType) | 731 Refinement(Primitive value, this.refineType) |
| 732 : value = new Reference<Primitive>(value); | 732 : value = new Reference<Primitive>(value); |
| 733 | 733 |
| 734 bool get hasValue => true; | 734 bool get hasValue => true; |
| 735 bool get isSafeForElimination => true; | 735 bool get isSafeForElimination => false; |
| 736 bool get isSafeForReordering => false; | 736 bool get isSafeForReordering => false; |
| 737 | 737 |
| 738 accept(Visitor visitor) => visitor.visitRefinement(this); | 738 accept(Visitor visitor) => visitor.visitRefinement(this); |
| 739 | 739 |
| 740 Primitive get effectiveDefinition => value.definition.effectiveDefinition; | 740 Primitive get effectiveDefinition => value.definition.effectiveDefinition; |
| 741 | 741 |
| 742 void setParentPointers() { | 742 void setParentPointers() { |
| 743 value.parent = this; | 743 value.parent = this; |
| 744 } | 744 } |
| 745 } | 745 } |
| (...skipping 2048 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2794 plug(new Branch.loose(_definitions.getCopy(node.condition), | 2794 plug(new Branch.loose(_definitions.getCopy(node.condition), |
| 2795 _copies[node.trueContinuation.definition], | 2795 _copies[node.trueContinuation.definition], |
| 2796 _copies[node.falseContinuation.definition]) | 2796 _copies[node.falseContinuation.definition]) |
| 2797 ..isStrictCheck = node.isStrictCheck); | 2797 ..isStrictCheck = node.isStrictCheck); |
| 2798 } | 2798 } |
| 2799 | 2799 |
| 2800 visitUnreachable(Unreachable node) { | 2800 visitUnreachable(Unreachable node) { |
| 2801 plug(new Unreachable()); | 2801 plug(new Unreachable()); |
| 2802 } | 2802 } |
| 2803 } | 2803 } |
| OLD | NEW |