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

Unified Diff: pkg/compiler/lib/src/js_emitter/lazy_emitter/model_emitter.dart

Issue 1491413008: Canonical output ordering for constants. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: baseline for fix 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/lazy_emitter/model_emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/lazy_emitter/model_emitter.dart b/pkg/compiler/lib/src/js_emitter/lazy_emitter/model_emitter.dart
index 485195ee92768c3d71cfb130ca70d760b05f4239..96838acd777085862c3102e24640a8cd5e9b6da4 100644
--- a/pkg/compiler/lib/src/js_emitter/lazy_emitter/model_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/lazy_emitter/model_emitter.dart
@@ -21,6 +21,7 @@ import '../../js_backend/js_backend.dart' show
ConstantEmitter;
import '../js_emitter.dart' show NativeEmitter;
+import '../constant_ordering.dart' show deepCompareConstants;
import 'package:js_runtime/shared/embedded_names.dart' show
CREATE_NEW_ISOLATE,
@@ -108,9 +109,9 @@ class ModelEmitter {
// 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 the constant name (i.e. JS
- // name) which is unique.
- return namer.constantName(a).compareTo(namer.constantName(b));
+
+ // Resolve collisions in the long name by using a structural order.
+ return deepCompareConstants(a, b);
}
js.Expression generateStaticClosureAccess(FunctionElement element) {

Powered by Google App Engine
This is Rietveld 408576698