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

Unified Diff: pkg/compiler/lib/src/constants/expressions.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/constants/expressions.dart
diff --git a/pkg/compiler/lib/src/constants/expressions.dart b/pkg/compiler/lib/src/constants/expressions.dart
index 0c6a6ac8795f0ace9761a22530c484b75f32e21f..13c799f8bb0a00b44e07e3d9e747f578a46cd8a2 100644
--- a/pkg/compiler/lib/src/constants/expressions.dart
+++ b/pkg/compiler/lib/src/constants/expressions.dart
@@ -28,6 +28,7 @@ enum ConstantExpressionKind {
CONSTRUCTED,
DEFERRED,
DOUBLE,
+ DUMMY,
ERRONEOUS,
FUNCTION,
IDENTICAL,
@@ -335,6 +336,34 @@ class ErroneousConstantExpression extends ConstantExpression {
bool _equals(ErroneousConstantExpression other) => true;
}
+class DummyConstantExpression extends ConstantExpression {
Johnni Winther 2015/05/28 12:07:17 Add a TODO for me to see if we can avoid the need
herhut 2015/06/01 12:09:41 Done.
+ final DummyConstantValue value;
+
+ DummyConstantExpression(this.value);
+
+ @override
+ ConstantValue evaluate(Environment environment,
+ ConstantSystem constantSystem) {
+ return value;
+ }
+
+ @override
+ int _computeHashCode() => 13 * value.hashCode;
+
+ accept(ConstantExpressionVisitor visitor, [context]) {
+ throw "unsupported";
+ }
+
+ @override
+ bool _equals(BoolConstantExpression other) {
+ return value == other.value;
+ }
+
+ ConstantExpressionKind get kind => ConstantExpressionKind.DUMMY;
+}
+
+
+
/// A boolean, int, double, string, or null constant.
abstract class PrimitiveConstantExpression extends ConstantExpression {
final PrimitiveConstantValue value;
« no previous file with comments | « no previous file | pkg/compiler/lib/src/constants/values.dart » ('j') | pkg/compiler/lib/src/constants/values.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698