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

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: Minor cleanups 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/types/constants.dart
diff --git a/pkg/compiler/lib/src/types/constants.dart b/pkg/compiler/lib/src/types/constants.dart
index 7ba262165aec0e36e6940718b68e8a738b795e68..ec39d45da075fc4c498fefe151dd7bc8e04ca915 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 SyntheticConstantKind;
/// Computes the [TypeMask] for the constant [value].
TypeMask computeTypeMask(Compiler compiler, ConstantValue value) {
@@ -45,8 +46,19 @@ class ConstantValueTypeMasks extends ConstantValueVisitor<TypeMask, Compiler> {
}
@override
- TypeMask visitDummy(DummyConstantValue constant, Compiler compiler) {
- return constant.typeMask;
+ TypeMask visitSynthetic(SyntheticConstantValue constant, Compiler compiler) {
+ switch (constant.kind) {
+ case SyntheticConstantKind.DUMMY_INTERCEPTOR:
+ return constant.payload;
+ case SyntheticConstantKind.EMPTY_VALUE:
+ return constant.payload;
+ case SyntheticConstantKind.TYPEVARIABLE_REFERENCE:
+ return compiler.typesTask.intType;
+ default:
+ compiler.internalError(compiler.currentElement,
+ "Unexpected DummyConstantKind.");
+ return null;
+ }
}
@override

Powered by Google App Engine
This is Rietveld 408576698