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

Issue 270813004: Evaluate constant instance creation expressions in ConstantValueComputer. (Closed)

Created:
6 years, 7 months ago by Paul Berry
Modified:
6 years, 7 months ago
Reviewers:
Brian Wilkerson
CC:
reviews_dartlang.org, ricow1
Visibility:
Public.

Description

Evaluate constant instance creation expressions in ConstantValueComputer. Previously, we evaluated them in ConstantVisitor; as a result we couldn't take advantage of the ConstantValueComputer's depedendency graph, so we couldn't detect cycles involving constant constructor declarations. This will become important soon, when we expand our constant evaluation logic to traverse constructor field initializers. With this change, ConstantValueComputer stores the computed value of each constant instance creation expression in the AST (similar to how it stores the computed value of each constant variable in the element model), and ConstantVisitor simply looks up the already-computed value. R=brianwilkerson@google.com Committed: https://code.google.com/p/dart/source/detail?r=35969

Patch Set 1 #

Total comments: 8
Unified diffs Side-by-side diffs Delta from patch set Stats (+680 lines, -331 lines) Patch
M editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/ast/InstanceCreationExpression.java View 4 chunks +27 lines, -0 lines 0 comments Download
M editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ConstantFinder.java View 4 chunks +49 lines, -0 lines 2 comments Download
M editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ConstantValueComputer.java View 4 chunks +157 lines, -18 lines 3 comments Download
M editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ConstantVisitor.java View 6 chunks +51 lines, -133 lines 0 comments Download
M editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ReferenceFinder.java View 5 chunks +29 lines, -9 lines 0 comments Download
M editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/constant/ConstantFinderTest.java View 1 chunk +98 lines, -27 lines 0 comments Download
M editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/constant/ConstantValueComputerTest.java View 4 chunks +143 lines, -0 lines 3 comments Download
M editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/constant/ConstantVisitorTest.java View 4 chunks +2 lines, -102 lines 0 comments Download
M editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/constant/ReferenceFinderTest.java View 1 chunk +124 lines, -39 lines 0 comments Download
M tests/language/language_analyzer.status View 1 chunk +0 lines, -3 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Paul Berry
6 years, 7 months ago (2014-05-08 20:44:49 UTC) #1
Brian Wilkerson
LGTM https://codereview.chromium.org/270813004/diff/1/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ConstantFinder.java File editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ConstantFinder.java (right): https://codereview.chromium.org/270813004/diff/1/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ConstantFinder.java#newcode46 editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ConstantFinder.java:46: private HashSet<InstanceCreationExpression> constructorInvocations = new HashSet<InstanceCreationExpression>(); I don't ...
6 years, 7 months ago (2014-05-08 22:12:48 UTC) #2
Paul Berry
https://codereview.chromium.org/270813004/diff/1/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ConstantFinder.java File editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ConstantFinder.java (right): https://codereview.chromium.org/270813004/diff/1/editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ConstantFinder.java#newcode46 editor/tools/plugins/com.google.dart.engine/src/com/google/dart/engine/internal/constant/ConstantFinder.java:46: private HashSet<InstanceCreationExpression> constructorInvocations = new HashSet<InstanceCreationExpression>(); On 2014/05/08 22:12:49, ...
6 years, 7 months ago (2014-05-08 23:12:45 UTC) #3
Brian Wilkerson
LGTM https://codereview.chromium.org/270813004/diff/1/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/constant/ConstantValueComputerTest.java File editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/constant/ConstantValueComputerTest.java (right): https://codereview.chromium.org/270813004/diff/1/editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/constant/ConstantValueComputerTest.java#newcode211 editor/tools/plugins/com.google.dart.engine_test/src/com/google/dart/engine/internal/constant/ConstantValueComputerTest.java:211: // x depends on "const A()" I can ...
6 years, 7 months ago (2014-05-08 23:53:40 UTC) #4
Paul Berry
6 years, 7 months ago (2014-05-09 12:51:41 UTC) #5
Message was sent while issue was closed.
Committed patchset #1 manually as r35969 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698