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

Unified Diff: pkg/compiler/lib/src/js_emitter/startup_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/startup_emitter/model_emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/startup_emitter/model_emitter.dart b/pkg/compiler/lib/src/js_emitter/startup_emitter/model_emitter.dart
index 95f0c3b3ee73eef20ddb892d81a082ade3a16157..9e81bca631b5918104099b25a6888581e2cce847 100644
--- a/pkg/compiler/lib/src/js_emitter/startup_emitter/model_emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/startup_emitter/model_emitter.dart
@@ -56,6 +56,7 @@ import '../../js_backend/js_backend.dart' show
import '../../util/uri_extras.dart' show
relativize;
+import '../constant_ordering.dart' show deepCompareConstants;
import '../headers.dart';
import '../js_emitter.dart' show
NativeEmitter;
@@ -140,9 +141,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) {
« no previous file with comments | « pkg/compiler/lib/src/js_emitter/lazy_emitter/model_emitter.dart ('k') | tests/compiler/dart2js_extra/many_constants_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698