| 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 | 4 |
| 5 // IrNodes are kept in a separate library to have precise control over their | 5 // IrNodes are kept in a separate library to have precise control over their |
| 6 // dependencies on other parts of the system. | 6 // dependencies on other parts of the system. |
| 7 library dart2js.ir_nodes; | 7 library dart2js.ir_nodes; |
| 8 | 8 |
| 9 import '../constants/expressions.dart'; | 9 import '../constants/expressions.dart'; |
| 10 import '../constants/values.dart' as values show ConstantValue; | 10 import '../constants/values.dart' as values show ConstantValue; |
| 11 import '../dart2jslib.dart' as dart2js show invariant; | 11 import '../dart2jslib.dart' as dart2js show invariant; |
| 12 import '../elements/elements.dart'; | 12 import '../elements/elements.dart'; |
| 13 import '../universe/universe.dart' show Selector, SelectorKind; | 13 import '../universe/universe.dart' show Selector, SelectorKind; |
| 14 import '../dart_types.dart' show DartType, GenericType; | 14 import '../dart_types.dart' show DartType, GenericType; |
| 15 | 15 |
| 16 abstract class Node { | 16 abstract class Node { |
| 17 static int hashCount = 0; | |
| 18 final int hashCode = hashCount = (hashCount + 1) & 0x3fffffff; | |
| 19 | |
| 20 /// A pointer to the parent node. Is null until set by optimization passes. | 17 /// A pointer to the parent node. Is null until set by optimization passes. |
| 21 Node parent; | 18 Node parent; |
| 22 | 19 |
| 23 accept(Visitor visitor); | 20 accept(Visitor visitor); |
| 24 } | 21 } |
| 25 | 22 |
| 26 abstract class Expression extends Node { | 23 abstract class Expression extends Node { |
| 27 Expression plug(Expression expr) => throw 'impossible'; | 24 Expression plug(Expression expr) => throw 'impossible'; |
| 28 } | 25 } |
| 29 | 26 |
| (...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 } | 972 } |
| 976 | 973 |
| 977 // JavaScript specific nodes. | 974 // JavaScript specific nodes. |
| 978 | 975 |
| 979 void visitIdentical(Identical node) { | 976 void visitIdentical(Identical node) { |
| 980 visitReference(node.left); | 977 visitReference(node.left); |
| 981 visitReference(node.right); | 978 visitReference(node.right); |
| 982 } | 979 } |
| 983 } | 980 } |
| 984 | 981 |
| OLD | NEW |