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

Unified Diff: pkg/compiler/lib/src/types/constants.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/types/constants.dart
diff --git a/pkg/compiler/lib/src/types/constants.dart b/pkg/compiler/lib/src/types/constants.dart
index 7ba262165aec0e36e6940718b68e8a738b795e68..c2160ff77ecf1a4c36f0be7ff0944342926233f2 100644
--- a/pkg/compiler/lib/src/types/constants.dart
+++ b/pkg/compiler/lib/src/types/constants.dart
@@ -7,6 +7,7 @@ library types.constants;
import '../constants/values.dart';
import '../dart2jslib.dart';
import 'types.dart';
+import '../js_backend/js_backend.dart' show DummyConstantKinds;
/// Computes the [TypeMask] for the constant [value].
TypeMask computeTypeMask(Compiler compiler, ConstantValue value) {
@@ -46,7 +47,18 @@ class ConstantValueTypeMasks extends ConstantValueVisitor<TypeMask, Compiler> {
@override
TypeMask visitDummy(DummyConstantValue constant, Compiler compiler) {
- return constant.typeMask;
+ switch (constant.kind) {
+ case DummyConstantKinds.dummyReceiver:
+ return constant.payload;
+ case DummyConstantKinds.emptyValue:
+ return constant.payload;
+ case DummyConstantKinds.typeVariableReference:
+ return compiler.typesTask.intType;
+ default:
+ compiler.internalError(compiler.currentElement,
+ "Unexpected DummyConstantKind.");
+ return null;
+ }
}
@override

Powered by Google App Engine
This is Rietveld 408576698