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

Unified Diff: pkg/compiler/lib/src/constants/expressions.dart

Issue 1192103002: Support serialization of the compiler backbone. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Handle (bypass) external const constructors. Created 5 years, 5 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
« no previous file with comments | « pkg/compiler/lib/src/constants/constructors.dart ('k') | pkg/compiler/lib/src/dart2jslib.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 dc0a3d9c811489aa12f3f1700c6d5afd758d8702..4b1060c677ed0e4b6bcd90291a45f3bcde81e122 100644
--- a/pkg/compiler/lib/src/constants/expressions.dart
+++ b/pkg/compiler/lib/src/constants/expressions.dart
@@ -108,6 +108,22 @@ abstract class ConstantConstructor {
Map<FieldElement, ConstantExpression> computeInstanceFields(
List<ConstantExpression> arguments,
CallStructure callStructure);
+
+ accept(ConstantConstructorVisitor visitor, arg);
+}
+
+abstract class ConstantConstructorVisitor<R, A> {
+ const ConstantConstructorVisitor();
+
+ R visit(ConstantConstructor constantConstructor, A context) {
+ return constantConstructor.accept(this, context);
+ }
+
+ R visitGenerative(GenerativeConstantConstructor constructor, A arg);
+ R visitRedirectingGenerative(
+ RedirectingGenerativeConstantConstructor constructor, A arg);
+ R visitRedirectingFactory(
+ RedirectingFactoryConstantConstructor constructor, A arg);
}
/// A generative constant constructor.
@@ -142,6 +158,10 @@ class GenerativeConstantConstructor implements ConstantConstructor{
return appliedFieldMap;
}
+ accept(ConstantConstructorVisitor visitor, arg) {
+ return visitor.visitGenerative(this, arg);
+ }
+
int get hashCode {
int hash = Hashing.objectHash(type);
hash = Hashing.mapHash(defaultValues, hash);
@@ -233,6 +253,10 @@ class RedirectingGenerativeConstantConstructor implements ConstantConstructor {
return appliedFieldMap;
}
+ accept(ConstantConstructorVisitor visitor, arg) {
+ return visitor.visitRedirectingGenerative(this, arg);
+ }
+
int get hashCode {
int hash = Hashing.objectHash(thisConstructorInvocation);
return Hashing.mapHash(defaultValues, hash);
@@ -282,6 +306,10 @@ class RedirectingFactoryConstantConstructor implements ConstantConstructor {
return constantConstructor.computeInstanceFields(arguments, callStructure);
}
+ accept(ConstantConstructorVisitor visitor, arg) {
+ return visitor.visitRedirectingFactory(this, arg);
+ }
+
int get hashCode {
return Hashing.objectHash(targetConstructorInvocation);
}
« no previous file with comments | « pkg/compiler/lib/src/constants/constructors.dart ('k') | pkg/compiler/lib/src/dart2jslib.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698