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

Unified Diff: pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart

Issue 1511383002: Revert "Canonical output ordering for constants." (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years 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/full_emitter/emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart b/pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart
index b16379f5465ca7a8aa2e072146d7a0ab08a2734e..7abae77453072725cfc516457b948ff3321a62a8 100644
--- a/pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/full_emitter/emitter.dart
@@ -17,7 +17,6 @@ import '../js_emitter.dart' hide Emitter;
import '../js_emitter.dart' as js_emitter show Emitter;
import '../model.dart';
import '../program_builder/program_builder.dart';
-import '../constant_ordering.dart' show deepCompareConstants;
import '../../common.dart';
import '../../common/names.dart' show
@@ -253,9 +252,11 @@ class Emitter implements js_emitter.Emitter {
// which compresses a tiny bit better.
int r = namer.constantLongName(a).compareTo(namer.constantLongName(b));
if (r != 0) return r;
-
- // Resolve collisions in the long name by using a structural order.
- return deepCompareConstants(a, b);
+ // Resolve collisions in the long name by using the constant name (i.e. JS
+ // name) which is unique.
+ // TODO(herhut): Find a better way to resolve collisions.
+ return namer.constantName(a).hashCode.compareTo(
+ namer.constantName(b).hashCode);
}
@override

Powered by Google App Engine
This is Rietveld 408576698