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

Issue 8523034: Compile Time Constants cycle check (Closed)

Created:
9 years, 1 month ago by zundel
Modified:
9 years, 1 month ago
Reviewers:
mmendez, srdjan
CC:
reviews_dartlang.org, gbracha
Visibility:
Public.

Description

Compile Time Constants cycle check http://code.google.com/p/dart/issues/detail?id=120 This adds a check to compile time constants to make sure there are no cycles. This turned out to be a bit more difficult than I had hoped, due to interaction with incremenatal compile, when only a diet parse tree was available for modules that did not need a full compile. To fix this, I added a lite resolution step (CompileTimeConstantResolver) to be performed on all units. Committed: https://code.google.com/p/dart/source/detail?r=1625

Patch Set 1 : Reverted DartCompiler.java back to just bare necessities #

Total comments: 5

Patch Set 2 : Removed some unecessary files, updated language.status #

Total comments: 23

Patch Set 3 : Removed TypeAnalyzer.java #

Patch Set 4 : Removed setType() from DartExpression node #

Total comments: 2

Patch Set 5 : Feedback from VM team over ConstInit5NegativeTest #

Patch Set 6 : Feedback from mmendez #

Patch Set 7 : Added new test to exercise code that was throwing ICE #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1095 lines, -577 lines) Patch
M compiler/java/com/google/dart/compiler/DartCompiler.java View 2 chunks +8 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/DefaultCompilerConfiguration.java View 2 chunks +2 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/ast/DartExpression.java View 1 2 3 2 chunks +0 lines, -12 lines 0 comments Download
D compiler/java/com/google/dart/compiler/resolver/CompileTimeConstVisitor.java View 1 chunk +0 lines, -410 lines 0 comments Download
A compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantAnalyzer.java View 1 2 3 4 5 6 1 chunk +572 lines, -0 lines 0 comments Download
A compiler/java/com/google/dart/compiler/resolver/CompileTimeConstantResolver.java View 1 2 3 4 5 1 chunk +199 lines, -0 lines 0 comments Download
compiler/java/com/google/dart/compiler/resolver/Elements.java View 1 chunk +1 line, -1 line 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/MemberBuilder.java View 2 chunks +2 lines, -0 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/Resolver.java View 8 chunks +4 lines, -25 lines 0 comments Download
M compiler/java/com/google/dart/compiler/resolver/ResolverErrorCode.java View 1 2 3 4 5 2 chunks +5 lines, -0 lines 0 comments Download
M compiler/javatests/com/google/dart/compiler/resolver/CompileTimeConstantTest.java View 22 chunks +201 lines, -121 lines 0 comments Download
M compiler/javatests/com/google/dart/compiler/resolver/ResolverTestCase.java View 4 chunks +49 lines, -5 lines 0 comments Download
M tests/language/language.status View 1 2 3 4 1 chunk +0 lines, -3 lines 0 comments Download
A tests/language/src/CTConst3Test.dart View 1 chunk +14 lines, -0 lines 0 comments Download
A tests/language/src/CTConst4Lib.dart View 1 2 3 4 5 6 1 chunk +8 lines, -0 lines 0 comments Download
A tests/language/src/CTConst4Test.dart View 1 2 3 4 5 6 1 chunk +13 lines, -0 lines 0 comments Download
A tests/language/src/ConstInit5NegativeTest.dart View 1 2 3 4 1 chunk +17 lines, -0 lines 0 comments Download

Messages

Total messages: 8 (0 generated)
zundel
http://codereview.chromium.org/8523034/diff/20/compiler/java/com/google/dart/compiler/resolver/CompileTimeConstVisitor.java File compiler/java/com/google/dart/compiler/resolver/CompileTimeConstVisitor.java (left): http://codereview.chromium.org/8523034/diff/20/compiler/java/com/google/dart/compiler/resolver/CompileTimeConstVisitor.java#oldcode39 compiler/java/com/google/dart/compiler/resolver/CompileTimeConstVisitor.java:39: public class CompileTimeConstVisitor extends DartNodeTraverser<Void> { Renamed to CompileTimeConstVisitor. ...
9 years, 1 month ago (2011-11-16 19:25:01 UTC) #1
srdjan
DBC http://codereview.chromium.org/8523034/diff/8001/tests/language/src/ConstInit5NegativeTest.dart File tests/language/src/ConstInit5NegativeTest.dart (right): http://codereview.chromium.org/8523034/diff/8001/tests/language/src/ConstInit5NegativeTest.dart#newcode10 tests/language/src/ConstInit5NegativeTest.dart:10: int main() { You must invoke C getter ...
9 years, 1 month ago (2011-11-16 22:03:11 UTC) #2
zundel
http://codereview.chromium.org/8523034/diff/8001/tests/language/src/ConstInit5NegativeTest.dart File tests/language/src/ConstInit5NegativeTest.dart (right): http://codereview.chromium.org/8523034/diff/8001/tests/language/src/ConstInit5NegativeTest.dart#newcode10 tests/language/src/ConstInit5NegativeTest.dart:10: int main() { On 2011/11/16 22:03:11, srdjan wrote: > ...
9 years, 1 month ago (2011-11-17 14:56:45 UTC) #3
mmendez
http://codereview.chromium.org/8523034/diff/6001/compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java File compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java (right): http://codereview.chromium.org/8523034/diff/6001/compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java#newcode24 compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java:24: public class ClassElementImplementation extends AbstractElement implements ClassElement { I ...
9 years, 1 month ago (2011-11-17 15:32:10 UTC) #4
zundel
http://codereview.chromium.org/8523034/diff/6001/compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java File compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java (right): http://codereview.chromium.org/8523034/diff/6001/compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java#newcode24 compiler/java/com/google/dart/compiler/resolver/ClassElementImplementation.java:24: public class ClassElementImplementation extends AbstractElement implements ClassElement { On ...
9 years, 1 month ago (2011-11-17 16:26:42 UTC) #5
mmendez
I think that this is looking good, but I see and ICE when I try ...
9 years, 1 month ago (2011-11-17 18:18:22 UTC) #6
zundel
Updated patch with new test.
9 years, 1 month ago (2011-11-17 18:55:01 UTC) #7
mmendez
9 years, 1 month ago (2011-11-17 19:34:30 UTC) #8
On 2011/11/17 18:55:01, zundel wrote:
> Updated patch with new test.

LGTM

It would be good to confirm that the following code should or should not
generate a type warning:

final A = "Hello";
final int B = A;

I assume not since A is dynamic, but it could not hurt.

Powered by Google App Engine
This is Rietveld 408576698