Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2099)

Unified Diff: pkg/compiler/lib/src/js_emitter/constant_ordering.dart

Issue 2620023002: Use elements/types in constants/values (Closed)
Patch Set: Created 3 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: pkg/compiler/lib/src/js_emitter/constant_ordering.dart
diff --git a/pkg/compiler/lib/src/js_emitter/constant_ordering.dart b/pkg/compiler/lib/src/js_emitter/constant_ordering.dart
index 19917267c6bfadbca24bbe0074779a3d26bf686e..49b77e7ab8f031232eafb3c475bb28a9964d91f3 100644
--- a/pkg/compiler/lib/src/js_emitter/constant_ordering.dart
+++ b/pkg/compiler/lib/src/js_emitter/constant_ordering.dart
@@ -105,7 +105,9 @@ class _CompareVisitor implements ConstantValueVisitor<int, ConstantValue> {
int visitList(ListConstantValue a, ListConstantValue b) {
int r = compareLists(compareValues, a.entries, b.entries);
if (r != 0) return r;
- return compareDartTypes(a.type, b.type);
+ ResolutionInterfaceType type1 = a.type;
+ ResolutionInterfaceType type2 = b.type;
+ return compareDartTypes(type1, type2);
}
int visitMap(MapConstantValue a, MapConstantValue b) {
@@ -113,11 +115,15 @@ class _CompareVisitor implements ConstantValueVisitor<int, ConstantValue> {
if (r != 0) return r;
r = compareLists(compareValues, a.values, b.values);
if (r != 0) return r;
- return compareDartTypes(a.type, b.type);
+ ResolutionInterfaceType type1 = a.type;
+ ResolutionInterfaceType type2 = b.type;
+ return compareDartTypes(type1, type2);
}
int visitConstructed(ConstructedConstantValue a, ConstructedConstantValue b) {
- int r = compareDartTypes(a.type, b.type);
+ ResolutionInterfaceType type1 = a.type;
+ ResolutionInterfaceType type2 = b.type;
+ int r = compareDartTypes(type1, type2);
if (r != 0) return r;
List<FieldEntity> aFields = a.fields.keys.toList()..sort(compareElements);
@@ -135,11 +141,13 @@ class _CompareVisitor implements ConstantValueVisitor<int, ConstantValue> {
int visitType(TypeConstantValue a, TypeConstantValue b) {
int r = compareDartTypes(a.representedType, b.representedType);
if (r != 0) return r;
- return compareDartTypes(a.type, b.type);
+ ResolutionInterfaceType type1 = a.type;
+ ResolutionInterfaceType type2 = b.type;
+ return compareDartTypes(type1, type2);
}
int visitInterceptor(InterceptorConstantValue a, InterceptorConstantValue b) {
- return compareDartTypes(a.dispatchedType, b.dispatchedType);
+ return compareElements(a.cls, b.cls);
}
int visitSynthetic(SyntheticConstantValue a, SyntheticConstantValue b) {

Powered by Google App Engine
This is Rietveld 408576698