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

Unified Diff: pkg/compiler/lib/src/js_backend/namer.dart

Issue 1367723005: Revert "dart2js: fix nondeterministic output of type metadata." (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 5 years, 3 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
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_backend/namer.dart
diff --git a/pkg/compiler/lib/src/js_backend/namer.dart b/pkg/compiler/lib/src/js_backend/namer.dart
index 1d1aba3d168a67a43e8872b60321ee30db7e73bd..541aa7b1b3fbfe3ddf29a745bf0b4628d339b962 100644
--- a/pkg/compiler/lib/src/js_backend/namer.dart
+++ b/pkg/compiler/lib/src/js_backend/namer.dart
@@ -1710,13 +1710,11 @@ class ConstantNamingVisitor implements ConstantValueVisitor {
@override
void visitType(TypeConstantValue constant, [_]) {
- // Generates something like 'Type_String_k8F', using the simple name of the
- // type and a hash to disambiguate the same name in different libraries.
addRoot('Type');
DartType type = constant.representedType;
- String simpleName = type.element.name;
- addIdentifier(simpleName);
- add(getHashTag(constant, 3));
+ JavaScriptBackend backend = compiler.backend;
+ String name = backend.rti.getTypeRepresentationForTypeConstant(type);
+ addIdentifier(name);
}
@override
@@ -1732,7 +1730,7 @@ class ConstantNamingVisitor implements ConstantValueVisitor {
add('dummy_receiver');
break;
case SyntheticConstantKind.TYPEVARIABLE_REFERENCE:
- // Omit. These are opaque deferred indexes with nothing helpful to add.
+ add('type_variable_reference');
break;
case SyntheticConstantKind.NAME:
add('name');
@@ -1831,7 +1829,6 @@ class ConstantCanonicalHasher implements ConstantValueVisitor<int, Null> {
int visitType(TypeConstantValue constant, [_]) {
DartType type = constant.representedType;
JavaScriptBackend backend = compiler.backend;
- // This name includes the library name and type parameters.
String name = backend.rti.getTypeRepresentationForTypeConstant(type);
return _hashString(4, name);
}
@@ -1843,18 +1840,15 @@ class ConstantCanonicalHasher implements ConstantValueVisitor<int, Null> {
}
@override
- int visitSynthetic(SyntheticConstantValue constant, [_]) {
+ visitSynthetic(SyntheticConstantValue constant, [_]) {
switch (constant.kind) {
case SyntheticConstantKind.TYPEVARIABLE_REFERENCE:
- // These contain a deferred opaque index into metadata. There is nothing
- // we can access that is stable between compiles. Luckily, since they
- // resolve to integer indexes, they're always part of a larger constant.
- return 0;
+ return constant.payload.hashCode;
default:
compiler.internalError(NO_LOCATION_SPANNABLE,
'SyntheticConstantValue should never be named and '
'never be subconstant');
- return 0;
+ return null;
}
}
« no previous file with comments | « pkg/compiler/lib/src/js_backend/backend.dart ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698