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

Issue 10837289: Split collecting and traversing. (Closed)

Created:
8 years, 4 months ago by Anton Muhin
Modified:
8 years, 4 months ago
Reviewers:
Roman
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Split collecting and traversing. R=smok@google.com Committed: https://code.google.com/p/dart/source/detail?r=10985

Patch Set 1 #

Total comments: 4

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+18 lines, -6 lines) Patch
M lib/compiler/implementation/dart_backend/backend.dart View 1 2 chunks +14 lines, -2 lines 0 comments Download
M tests/compiler/dart2js/unparser_test.dart View 1 1 chunk +4 lines, -4 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Anton Muhin
8 years, 4 months ago (2012-08-16 17:16:13 UTC) #1
Roman
lgtm https://chromiumcodereview.appspot.com/10837289/diff/1/lib/compiler/implementation/dart_backend/backend.dart File lib/compiler/implementation/dart_backend/backend.dart (right): https://chromiumcodereview.appspot.com/10837289/diff/1/lib/compiler/implementation/dart_backend/backend.dart#newcode108 lib/compiler/implementation/dart_backend/backend.dart:108: if (element is ClassElement) { I would prefer ...
8 years, 4 months ago (2012-08-17 08:22:28 UTC) #2
Anton Muhin
https://chromiumcodereview.appspot.com/10837289/diff/1/lib/compiler/implementation/dart_backend/backend.dart File lib/compiler/implementation/dart_backend/backend.dart (right): https://chromiumcodereview.appspot.com/10837289/diff/1/lib/compiler/implementation/dart_backend/backend.dart#newcode108 lib/compiler/implementation/dart_backend/backend.dart:108: if (element is ClassElement) { I actually started that ...
8 years, 4 months ago (2012-08-17 08:32:41 UTC) #3
Roman
https://chromiumcodereview.appspot.com/10837289/diff/1/lib/compiler/implementation/dart_backend/backend.dart File lib/compiler/implementation/dart_backend/backend.dart (right): https://chromiumcodereview.appspot.com/10837289/diff/1/lib/compiler/implementation/dart_backend/backend.dart#newcode108 lib/compiler/implementation/dart_backend/backend.dart:108: if (element is ClassElement) { On 2012/08/17 08:32:41, Anton ...
8 years, 4 months ago (2012-08-17 08:34:24 UTC) #4
Anton Muhin
8 years, 4 months ago (2012-08-17 08:38:04 UTC) #5
https://chromiumcodereview.appspot.com/10837289/diff/1/lib/compiler/implement...
File lib/compiler/implementation/dart_backend/backend.dart (right):

https://chromiumcodereview.appspot.com/10837289/diff/1/lib/compiler/implement...
lib/compiler/implementation/dart_backend/backend.dart:108: if (element is
ClassElement) {
Yes.

Now we go over all the member elements and put them in the map.

We could have done differently: when class is used, go over all its members and
check if they are resolved i.e. used.

On 2012/08/17 08:34:24, Roman wrote:
> On 2012/08/17 08:32:41, Anton Muhin wrote:
> > I actually started that way, but decided eventually against it.  The idea is
> in
> > contrast to the previous approach, classElement to members mapping is now
not
> > that important, the key data is a collection of top level.
> > 
> > As an experiment (it might be worth experimenting): we can probably omit
> > classMemebers altogether with the following trick: when emitting class, for
> each
> > member to be emitted, check if it got into resolvedElements.
> > 
> > On 2012/08/17 08:22:28, Roman wrote:
> > > I would prefer that class members are explicitly collected below, after we
> > > collect top level elements, like:
> > > classMembers.getValues().forEach(makePlaceholders);
> > > 
> > > I think it's cleaner.
> > 
> 
> Probably I'm wrong, but I think that some element gets into class's members
only
> when it is used, e.g. resolved.

Powered by Google App Engine
This is Rietveld 408576698