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

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: sra comments Created 5 years, 6 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 06267f89d3c7bb90e92511f99c891435829cd487..1e720d8dd87b0cf334b1e562581b63533061aed9 100644
--- a/pkg/compiler/lib/src/js_backend/namer.dart
+++ b/pkg/compiler/lib/src/js_backend/namer.dart
@@ -1543,8 +1543,18 @@ class ConstantNamingVisitor implements ConstantValueVisitor {
}
@override
- void visitDummy(DummyConstantValue constant, [_]) {
- add('dummy_receiver');
+ void visitSynthetic(SyntheticConstantValue constant, [_]) {
+ switch (constant.kind) {
+ case SyntheticConstantKind.DUMMY_RECEIVER:
+ add('dummy_receiver');
+ break;
+ case SyntheticConstantKind.TYPEVARIABLE_REFERENCE:
+ add('type_variable_reference');
+ break;
+ default:
+ compiler.internalError(compiler.currentElement,
+ "Unexpected SyntheticConstantValue");
+ }
}
@override
@@ -1646,9 +1656,16 @@ class ConstantCanonicalHasher implements ConstantValueVisitor<int, Null> {
}
@override
- visitDummy(DummyConstantValue constant, [_]) {
- compiler.internalError(NO_LOCATION_SPANNABLE,
- 'DummyReceiverConstant should never be named and never be subconstant');
+ visitSynthetic(SyntheticConstantValue constant, [_]) {
+ switch (constant.kind) {
+ case SyntheticConstantKind.TYPEVARIABLE_REFERENCE:
+ return constant.payload.hashCode;
+ default:
+ compiler.internalError(NO_LOCATION_SPANNABLE,
+ 'SyntheticConstantValue should never be named and '
+ 'never be subconstant');
+ return null;
+ }
}
@override

Powered by Google App Engine
This is Rietveld 408576698