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

Unified Diff: pkg/compiler/lib/src/constants/values.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: Addressed sra's 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/constants/values.dart
diff --git a/pkg/compiler/lib/src/constants/values.dart b/pkg/compiler/lib/src/constants/values.dart
index 69c89cf06d5d84e7d2796969f6089a9551c8efe1..9a53dc5b68f3036f3195f965475f00a348be41f9 100644
--- a/pkg/compiler/lib/src/constants/values.dart
+++ b/pkg/compiler/lib/src/constants/values.dart
@@ -32,7 +32,7 @@ abstract class ConstantValueVisitor<R, A> {
R visitConstructed(ConstructedConstantValue constant, A arg);
R visitType(TypeConstantValue constant, A arg);
R visitInterceptor(InterceptorConstantValue constant, A arg);
- R visitDummy(DummyConstantValue constant, A arg);
+ R visitSynthetic(SyntheticConstantValue constant, A arg);
R visitDeferred(DeferredConstantValue constant, A arg);
}
@@ -80,7 +80,7 @@ abstract class ConstantValue {
/// expression from the value so the unparse of these is best effort.
///
/// For the synthetic constants, [DeferredConstantValue],
- /// [DummyConstantValue], [InterceptorConstantValue] the unparse is
+ /// [SyntheticConstantValue], [InterceptorConstantValue] the unparse is
/// descriptive only.
String unparse();
@@ -603,30 +603,32 @@ class InterceptorConstantValue extends ConstantValue {
}
}
-// TODO(johnniwinther): Remove this class.
-class DummyConstantValue extends ConstantValue {
- final ti.TypeMask typeMask;
+class SyntheticConstantValue extends ConstantValue {
+ final payload;
+ final kind;
- DummyConstantValue(this.typeMask);
+ SyntheticConstantValue(this.kind, this.payload);
bool get isDummy => true;
bool operator ==(other) {
- return other is DummyConstantValue
- && typeMask == other.typeMask;
+ return other is SyntheticConstantValue
+ && payload == other.payload;
}
- get hashCode => typeMask.hashCode;
+ get hashCode => payload.hashCode * 17 + kind.hashCode;
List<ConstantValue> getDependencies() => const <ConstantValue>[];
- accept(ConstantValueVisitor visitor, arg) => visitor.visitDummy(this, arg);
+ accept(ConstantValueVisitor visitor, arg) {
+ return visitor.visitSynthetic(this, arg);
+ }
DartType getType(CoreTypes types) => const DynamicType();
- String unparse() => 'dummy($typeMask)';
+ String unparse() => 'synthetic($kind, $payload)';
- String toStructuredString() => 'DummyConstant($typeMask)';
+ String toStructuredString() => 'SyntheticConstant($kind, $payload)';
}
class ConstructedConstantValue extends ObjectConstantValue {
« no previous file with comments | « pkg/compiler/lib/src/constants/expressions.dart ('k') | pkg/compiler/lib/src/cps_ir/cps_ir_nodes_sexpr.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698