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

Issue 9808006: Resolve initializers in their proper scope. (Closed)

Created:
8 years, 9 months ago by ahe
Modified:
8 years, 9 months ago
Reviewers:
floitsch, ngeoffray
CC:
reviews_dartlang.org, compiler-dev_dartlang.org
Visibility:
Public.

Description

Resolve initializers in their proper scope. Committed: https://code.google.com/p/dart/source/detail?r=5773

Patch Set 1 : #

Patch Set 2 : Revert bogus changes #

Total comments: 9

Patch Set 3 : Address review comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+33 lines, -13 lines) Patch
M dart/frog/leg/compile_time_constants.dart View 2 chunks +5 lines, -1 line 0 comments Download
M dart/frog/leg/resolver.dart View 1 2 3 chunks +14 lines, -6 lines 0 comments Download
M dart/frog/leg/tree/nodes.dart View 1 2 1 chunk +13 lines, -0 lines 0 comments Download
M dart/tests/language/language-leg.status View 1 chunk +0 lines, -1 line 0 comments Download
M dart/tests/language/src/Issue4515170Test.dart View 1 chunk +1 line, -5 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
ahe
8 years, 9 months ago (2012-03-22 17:29:14 UTC) #1
ahe
Uploaded a new version, turned out that my changes to closure were bogus.
8 years, 9 months ago (2012-03-23 00:28:23 UTC) #2
floitsch
LGTM. The compile-time constant test should soon not be necessary anymore, but I can very ...
8 years, 9 months ago (2012-03-23 06:46:16 UTC) #3
ngeoffray
LGTM https://chromiumcodereview.appspot.com/9808006/diff/5001/dart/frog/leg/compile_time_constants.dart File dart/frog/leg/compile_time_constants.dart (right): https://chromiumcodereview.appspot.com/9808006/diff/5001/dart/frog/leg/compile_time_constants.dart#newcode1004 dart/frog/leg/compile_time_constants.dart:1004: compiler.withCurrentElement(currentElement, () { Why is that necessary? The ...
8 years, 9 months ago (2012-03-23 07:50:22 UTC) #4
ahe
8 years, 9 months ago (2012-03-23 11:30:31 UTC) #5
Hi Florian and Nicolas,

Thank you for your thoughts.

Cheers,
Peter

https://chromiumcodereview.appspot.com/9808006/diff/5001/dart/frog/leg/compil...
File dart/frog/leg/compile_time_constants.dart (right):

https://chromiumcodereview.appspot.com/9808006/diff/5001/dart/frog/leg/compil...
dart/frog/leg/compile_time_constants.dart:1004:
compiler.withCurrentElement(currentElement, () {
On 2012/03/23 07:50:22, ngeoffray wrote:
> Why is that necessary? The withCurrentElement line 1024 should be enough.

That's the wrong element. It is the element for the constructor that is being
inlined, not the element of the node.

This will get more ugly the more we inline. We need to find a better solution
than withCurrentElement.

https://chromiumcodereview.appspot.com/9808006/diff/5001/dart/frog/leg/resolv...
File dart/frog/leg/resolver.dart (right):

https://chromiumcodereview.appspot.com/9808006/diff/5001/dart/frog/leg/resolv...
dart/frog/leg/resolver.dart:51: return resolveVariableElement(element);
On 2012/03/23 07:50:22, ngeoffray wrote:
> Should that be renamed to resolveField then?

Done.

https://chromiumcodereview.appspot.com/9808006/diff/5001/dart/frog/leg/resolv...
dart/frog/leg/resolver.dart:194: initializerDo(tree, visitor.visit);
On 2012/03/23 07:50:22, ngeoffray wrote:
> On 2012/03/23 06:46:17, floitsch wrote:
> > I would prefer keeping this function locally here (and duplicate in other
> > classes if necessary).
> 
> +1
> 
> > Also I would prefer 'visitPotentialInitializer'.
> 
> visitPotentialInitializer -> handlePotentialInitializer

I would like to discuss this in person. I'll keep the current version but add a
TODO that we need to consider if this pattern is acceptable.

Perhaps this should be a method on Node. I'm trying to make certain operations
easier as they are repeated in many places.

https://chromiumcodereview.appspot.com/9808006/diff/5001/dart/frog/leg/resolv...
dart/frog/leg/resolver.dart:201: new ResolverVisitor(compiler,
element.enclosingElement);
On 2012/03/23 06:46:17, floitsch wrote:
> 4 chars indent.

Done.

Powered by Google App Engine
This is Rietveld 408576698