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

Issue 10826234: Support some usages of empty classes. (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

Support some usages of empty classes. Positions like is, as, return types and argument types should be now processed. R=smok@google.com Committed: https://code.google.com/p/dart/source/detail?r=10484

Patch Set 1 #

Total comments: 8

Patch Set 2 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+22 lines, -40 lines) Patch
M lib/compiler/implementation/dart_backend/backend.dart View 1 3 chunks +14 lines, -6 lines 0 comments Download
M tests/compiler/dart2js/unparser_test.dart View 1 chunk +3 lines, -10 lines 0 comments Download
M tests/language/language.status View 1 6 chunks +5 lines, -24 lines 0 comments Download

Messages

Total messages: 6 (0 generated)
Anton Muhin
8 years, 4 months ago (2012-08-09 19:47:03 UTC) #1
Anton Muhin
Roma, I have some more changes in pipeline, but they depend on this one. Just ...
8 years, 4 months ago (2012-08-09 19:48:21 UTC) #2
Roman
https://chromiumcodereview.appspot.com/10826234/diff/1/lib/compiler/implementation/dart_backend/backend.dart File lib/compiler/implementation/dart_backend/backend.dart (right): https://chromiumcodereview.appspot.com/10826234/diff/1/lib/compiler/implementation/dart_backend/backend.dart#newcode80 lib/compiler/implementation/dart_backend/backend.dart:80: new ReferencedElementCollector( This is probably controversial, but I think ...
8 years, 4 months ago (2012-08-10 07:27:39 UTC) #3
Anton Muhin
PTAL I added a suppression for try_catch_test as it has been migrated to new syntax ...
8 years, 4 months ago (2012-08-10 08:33:37 UTC) #4
Roman
lgtm https://chromiumcodereview.appspot.com/10826234/diff/1/lib/compiler/implementation/dart_backend/backend.dart File lib/compiler/implementation/dart_backend/backend.dart (right): https://chromiumcodereview.appspot.com/10826234/diff/1/lib/compiler/implementation/dart_backend/backend.dart#newcode108 lib/compiler/implementation/dart_backend/backend.dart:108: if (resolvedClassMembers.containsKey(classElement)) return; On 2012/08/10 08:33:37, Anton Muhin ...
8 years, 4 months ago (2012-08-10 08:46:01 UTC) #5
Anton Muhin
8 years, 4 months ago (2012-08-10 08:56:48 UTC) #6
https://chromiumcodereview.appspot.com/10826234/diff/1/lib/compiler/implement...
File lib/compiler/implementation/dart_backend/backend.dart (right):

https://chromiumcodereview.appspot.com/10826234/diff/1/lib/compiler/implement...
lib/compiler/implementation/dart_backend/backend.dart:108: if
(resolvedClassMembers.containsKey(classElement)) return;
I meant pretty simple thing: ReferencedElementCollector knows nothing about the
rest of the system.

I am seriously considering provide callbacks instead of collections, but I'ld
like to see how this part of system grows to take the ultimate decision.

On 2012/08/10 08:46:01, Roman wrote:
> On 2012/08/10 08:33:37, Anton Muhin wrote:
> > I am considering this too.  But for now I'd prefer to have minimal coupling
> > between components: this code just collects additional stuff and knows
nothing
> > about the rest of system.  That usually pays off.
> > 
> > On 2012/08/10 07:27:40, Roman wrote:
> > > Why not unify "classes" collection and "resolvedClassMembers"? The latter
> may
> > be
> > > renamed to "resolvedClasses". If referenced class does not have any
members
> we
> > > care about, the set it maps to will just be null. That's one less forEach
> > here.
> > 
> 
> "Not knowing about the rest of system" is not quite true. Here you utput
> elements from "classes" you check another contatiner "resolvedClassMembers",
so
> here is coupling.
> 
> Populating one container from different sources (collectors) does not add
> anything to coupling, one collector does not know anything about the other.
but
> if you unify them it would tell that we actually collecting the same kind of
> objects - classes that we use. And we even process them in the same way - with
> outputClass.
> 
> The downsides of current approach:
> 1) you have to check that you don't accidentally output the same element
twice,
> hence the check that classElement is not in resolvedClassMembers.
> 2) duplicating code that outputs the classes: from "classes" and from
> "resolvedClassMembers".

Powered by Google App Engine
This is Rietveld 408576698