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

Issue 10827359: Fix field-accesses for private fields that were "shadowed" by other private fields. (Closed)

Created:
8 years, 4 months ago by floitsch
Modified:
8 years, 4 months ago
Reviewers:
kasperl
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Fix field-accesses for private fields that were "shadowed" by other private fields. Committed: https://code.google.com/p/dart/source/detail?r=10827

Patch Set 1 #

Total comments: 6

Patch Set 2 : Use more selectors. #

Patch Set 3 : Update comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+62 lines, -31 lines) Patch
M lib/compiler/implementation/elements/elements.dart View 1 2 2 chunks +29 lines, -2 lines 0 comments Download
M lib/compiler/implementation/ssa/optimize.dart View 1 2 chunks +15 lines, -18 lines 0 comments Download
M lib/compiler/implementation/world.dart View 1 2 3 chunks +16 lines, -11 lines 0 comments Download
M tests/language/private1.dart View 1 1 chunk +2 lines, -0 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
floitsch
The problem: library1: class A { var _x; } new B()._x; // <== library2: class ...
8 years, 4 months ago (2012-08-15 21:20:48 UTC) #1
kasperl
LGTM, but I think this could be improved using selectors. https://chromiumcodereview.appspot.com/10827359/diff/1/lib/compiler/implementation/elements/elements.dart File lib/compiler/implementation/elements/elements.dart (right): https://chromiumcodereview.appspot.com/10827359/diff/1/lib/compiler/implementation/elements/elements.dart#newcode1066 ...
8 years, 4 months ago (2012-08-16 12:47:57 UTC) #2
floitsch
8 years, 4 months ago (2012-08-16 16:15:55 UTC) #3
I think we can push the usage of selectors even further, but for now I'm
committing as is.
Feel free to add comments and I will address them in a future CL.

https://chromiumcodereview.appspot.com/10827359/diff/1/lib/compiler/implement...
File lib/compiler/implementation/elements/elements.dart (right):

https://chromiumcodereview.appspot.com/10827359/diff/1/lib/compiler/implement...
lib/compiler/implementation/elements/elements.dart:1066: Element
lookupSuperMemberInLibrary(SourceString memberName,
On 2012/08/16 12:47:57, kasperl wrote:
> Would it be possible to start using Selector for looking up stuff? The
selector
> has a name and a library...

Went a little bit into that direction. It's not complete but better than before.

https://chromiumcodereview.appspot.com/10827359/diff/1/lib/compiler/implement...
File lib/compiler/implementation/ssa/optimize.dart (right):

https://chromiumcodereview.appspot.com/10827359/diff/1/lib/compiler/implement...
lib/compiler/implementation/ssa/optimize.dart:558: Element
findConcreteFieldForDynamicAccess(HInstruction receiver,
On 2012/08/16 12:47:57, kasperl wrote:
> Can you use a selector instead of the fieldName here? The HInvokeDynamicGetter
> should know the selector so you should know the library from that.

Done.

https://chromiumcodereview.appspot.com/10827359/diff/1/lib/compiler/implement...
File lib/compiler/implementation/world.dart (right):

https://chromiumcodereview.appspot.com/10827359/diff/1/lib/compiler/implement...
lib/compiler/implementation/world.dart:38: MemberSet _memberSetFor(Type type,
On 2012/08/16 12:47:57, kasperl wrote:
> Again it would seem like this could be rewritten with a selector instead of a
> (library, member) pair.

Done.

Powered by Google App Engine
This is Rietveld 408576698