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

Unified Diff: pkg/analyzer/lib/src/generated/ast.dart

Issue 1050203002: Begin making copies of AST nodes for constants during resolution. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Address review comments and switch to using mixins. Created 5 years, 9 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/analyzer/lib/src/generated/ast.dart
diff --git a/pkg/analyzer/lib/src/generated/ast.dart b/pkg/analyzer/lib/src/generated/ast.dart
index f937b19babee1019a1905b68e52e06330394a0a4..bbc8076d2c86b4738c13e4b677fdcf7b0dab55c7 100644
--- a/pkg/analyzer/lib/src/generated/ast.dart
+++ b/pkg/analyzer/lib/src/generated/ast.dart
@@ -5309,6 +5309,18 @@ class ConstantEvaluator extends GeneralizingAstVisitor<Object> {
}
/**
+ * Object representing a "const" instance creation expression, and its
+ * evaluation result. This is used as the AnalysisTarget for constant
+ * evaluation of instance creation expressions.
+ */
+class ConstantInstanceCreationHandle {
+ /**
+ * The result of evaluating the constant.
+ */
+ EvaluationResultImpl evaluationResult;
+}
+
+/**
* A constructor declaration.
*
* > constructorDeclaration ::=
@@ -10625,9 +10637,10 @@ class InstanceCreationExpression extends Expression {
ConstructorElement staticElement;
/**
- * The result of evaluating this expression, if it is constant.
+ * The [ConstantInstanceCreationHandle] holding the result of evaluating this
+ * expression, if it is constant.
*/
- EvaluationResultImpl evaluationResult;
+ ConstantInstanceCreationHandle constantHandle;
/**
* Initialize a newly created instance creation expression.
@@ -10675,6 +10688,16 @@ class InstanceCreationExpression extends Expression {
Token get endToken => _argumentList.endToken;
/**
+ * The result of evaluating this expression, if it is constant.
+ */
+ EvaluationResultImpl get evaluationResult {
+ if (constantHandle != null) {
+ return constantHandle.evaluationResult;
+ }
+ return null;
+ }
+
+ /**
* Return `true` if this creation expression is used to invoke a constant
* constructor.
*/
« no previous file with comments | « no previous file | pkg/analyzer/lib/src/generated/constant.dart » ('j') | pkg/analyzer/lib/src/generated/constant.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698