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

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

Issue 1153243003: dart2js: Use frequency of occurence to sort metadata indices. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 5 years, 7 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_backend/namer.dart
diff --git a/pkg/compiler/lib/src/js_backend/namer.dart b/pkg/compiler/lib/src/js_backend/namer.dart
index 4e15e5d3e00dbf2521b3a692de151a9562a7e4f9..87db683b408825bd15e86c68cb2b83bbc2864055 100644
--- a/pkg/compiler/lib/src/js_backend/namer.dart
+++ b/pkg/compiler/lib/src/js_backend/namer.dart
@@ -1531,7 +1531,17 @@ class ConstantNamingVisitor implements ConstantValueVisitor {
@override
void visitDummy(DummyConstantValue constant, [_]) {
- add('dummy_receiver');
+ switch (constant.kind) {
+ case DummyConstantKinds.dummyReceiver:
+ add('dummy_receiver');
+ break;
+ case DummyConstantKinds.typeVariableReference:
+ add('type_variable_reference');
+ break;
+ default:
+ compiler.internalError(compiler.currentElement,
+ "Unexpected DummyConstantValue");
+ }
}
@override
@@ -1634,8 +1644,15 @@ class ConstantCanonicalHasher implements ConstantValueVisitor<int, Null> {
@override
visitDummy(DummyConstantValue constant, [_]) {
- compiler.internalError(NO_LOCATION_SPANNABLE,
- 'DummyReceiverConstant should never be named and never be subconstant');
+ switch (constant.kind) {
+ case DummyConstantKinds.typeVariableReference:
+ return constant.payload.hashCode;
+ default:
+ compiler.internalError(NO_LOCATION_SPANNABLE,
+ 'DummyConstantValue should never be named and '
+ 'never be subconstant');
+ return null;
+ }
}
@override

Powered by Google App Engine
This is Rietveld 408576698