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

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: 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/constants/expressions.dart
diff --git a/pkg/compiler/lib/src/constants/expressions.dart b/pkg/compiler/lib/src/constants/expressions.dart
index 17f333ac785d6f95de149677e97d265053ccd50e..66b175e6c28fe7c2cbc058e6c1b0488f85d8fe1f 100644
--- a/pkg/compiler/lib/src/constants/expressions.dart
+++ b/pkg/compiler/lib/src/constants/expressions.dart
@@ -29,6 +29,7 @@ enum ConstantExpressionKind {
CONSTRUCTED,
DEFERRED,
DOUBLE,
+ DUMMY,
ERRONEOUS,
FUNCTION,
IDENTICAL,
@@ -334,6 +335,35 @@ class ErroneousConstantExpression extends ConstantExpression {
bool _equals(ErroneousConstantExpression other) => true;
}
+// TODO(johnniwinther): Avoid the need for this class.
+class SyntheticConstantExpression extends ConstantExpression {
+ final SyntheticConstantValue value;
+
+ SyntheticConstantExpression(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(SyntheticConstantExpression other) {
+ return value == other.value;
+ }
+
+ ConstantExpressionKind get kind => ConstantExpressionKind.DUMMY;
+}
+
+
+
/// A boolean, int, double, string, or null constant.
abstract class PrimitiveConstantExpression extends ConstantExpression {
/// The primitive value of this contant expression.
« no previous file with comments | « no previous file | pkg/compiler/lib/src/constants/values.dart » ('j') | pkg/compiler/lib/src/js_backend/backend.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698