| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, 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 dart2js.js_emitter.constant_ordering; | 5 library dart2js.js_emitter.constant_ordering; |
| 6 | 6 |
| 7 import '../constants/values.dart'; | 7 import '../constants/values.dart'; |
| 8 import '../elements/elements.dart' show Entity, Elements; | 8 import '../elements/elements.dart' show Entity, Elements; |
| 9 import '../elements/entities.dart' show FieldEntity; | 9 import '../elements/entities.dart' show FieldEntity; |
| 10 import '../elements/resolution_types.dart'; | 10 import '../elements/resolution_types.dart'; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 } | 44 } |
| 45 return 0; | 45 return 0; |
| 46 } | 46 } |
| 47 | 47 |
| 48 static int compareElements(Entity a, Entity b) { | 48 static int compareElements(Entity a, Entity b) { |
| 49 int r = a.name.compareTo(b.name); | 49 int r = a.name.compareTo(b.name); |
| 50 if (r != 0) return r; | 50 if (r != 0) return r; |
| 51 return Elements.compareByPosition(a, b); | 51 return Elements.compareByPosition(a, b); |
| 52 } | 52 } |
| 53 | 53 |
| 54 static int compareDartTypes(DartType a, DartType b) { | 54 static int compareDartTypes(ResolutionDartType a, ResolutionDartType b) { |
| 55 if (a == b) return 0; | 55 if (a == b) return 0; |
| 56 int r = a.kind.index.compareTo(b.kind.index); | 56 int r = a.kind.index.compareTo(b.kind.index); |
| 57 if (r != 0) return r; | 57 if (r != 0) return r; |
| 58 r = compareNullable(compareElements, a.element, b.element); | 58 r = compareNullable(compareElements, a.element, b.element); |
| 59 if (r != 0) return r; | 59 if (r != 0) return r; |
| 60 | 60 |
| 61 if (a is GenericType) { | 61 if (a is GenericType) { |
| 62 GenericType aGeneric = a; | 62 GenericType aGeneric = a; |
| 63 GenericType bGeneric = b; | 63 GenericType bGeneric = b; |
| 64 r = compareLists( | 64 r = compareLists( |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 206 int visitBool(BoolConstantValue a, _) => BOOL; | 206 int visitBool(BoolConstantValue a, _) => BOOL; |
| 207 int visitString(StringConstantValue a, _) => STRING; | 207 int visitString(StringConstantValue a, _) => STRING; |
| 208 int visitList(ListConstantValue a, _) => LIST; | 208 int visitList(ListConstantValue a, _) => LIST; |
| 209 int visitMap(MapConstantValue a, _) => MAP; | 209 int visitMap(MapConstantValue a, _) => MAP; |
| 210 int visitConstructed(ConstructedConstantValue a, _) => CONSTRUCTED; | 210 int visitConstructed(ConstructedConstantValue a, _) => CONSTRUCTED; |
| 211 int visitType(TypeConstantValue a, _) => TYPE; | 211 int visitType(TypeConstantValue a, _) => TYPE; |
| 212 int visitInterceptor(InterceptorConstantValue a, _) => INTERCEPTOR; | 212 int visitInterceptor(InterceptorConstantValue a, _) => INTERCEPTOR; |
| 213 int visitSynthetic(SyntheticConstantValue a, _) => SYNTHETIC; | 213 int visitSynthetic(SyntheticConstantValue a, _) => SYNTHETIC; |
| 214 int visitDeferred(DeferredConstantValue a, _) => DEFERRED; | 214 int visitDeferred(DeferredConstantValue a, _) => DEFERRED; |
| 215 } | 215 } |
| OLD | NEW |