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

Issue 10947024: Made dart2js constructor lookup logic "private"-aware, fixed 4740 bug. (Closed)

Created:
8 years, 3 months ago by aam-me
Modified:
8 years, 2 months ago
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Made dart2js constructor lookup logic "private"-aware, fixed 4740 bug. BUG=4740 TEST=dart2js_extra/4740_test.dart Committed: https://code.google.com/p/dart/source/detail?r=13557

Patch Set 1 #

Total comments: 4

Patch Set 2 : lookupConstructor now uses Selector. Introduced SelectorName class. #

Patch Set 3 : Fixed indentation. #

Total comments: 7

Patch Set 4 : Another try in implementing constructor lookup, without SelectorName this time. #

Total comments: 25

Patch Set 5 : Another attempt at implementing private-aware constructor lookup logic - with normalized constructo… #

Total comments: 3

Patch Set 6 : Rebased. #

Patch Set 7 : Use resolver.enclosingElement. Fixed line wrapping. #

Total comments: 14

Patch Set 8 : Removed normalizedConstructorName from Selector. #

Total comments: 6

Patch Set 9 : Removed class name parameter from Selector.callDefaultConstructor() constructor. #

Patch Set 10 : Fixed co19-dart2js.status merge error. #

Total comments: 28

Patch Set 11 : Incorporated Peter's comments and feedback. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+215 lines, -98 lines) Patch
M lib/compiler/implementation/compile_time_constants.dart View 1 2 3 4 5 6 7 8 1 chunk +5 lines, -4 lines 0 comments Download
M lib/compiler/implementation/elements/elements.dart View 1 2 3 4 5 6 7 8 9 10 1 chunk +29 lines, -11 lines 0 comments Download
M lib/compiler/implementation/resolver.dart View 1 2 3 4 5 6 7 8 9 10 8 chunks +163 lines, -77 lines 0 comments Download
M lib/compiler/implementation/ssa/builder.dart View 1 2 3 4 5 6 7 8 9 10 1 chunk +2 lines, -2 lines 0 comments Download
M lib/compiler/implementation/universe/universe.dart View 1 2 3 4 5 6 7 8 1 chunk +11 lines, -0 lines 0 comments Download
M tests/co19/co19-dart2js.status View 1 2 3 4 5 6 7 8 9 10 2 chunks +2 lines, -2 lines 0 comments Download
M tests/compiler/dart2js/resolver_test.dart View 1 2 3 4 5 6 7 8 1 chunk +3 lines, -1 line 0 comments Download
M tests/compiler/dart2js_extra/dart2js_extra.status View 1 2 3 4 5 6 7 8 9 10 1 chunk +0 lines, -1 line 0 comments Download

Messages

Total messages: 34 (0 generated)
aam-me
Karl, hopefully you don't mind me looking at the issue 4740 you own. I was ...
8 years, 3 months ago (2012-09-19 04:53:42 UTC) #1
ahe
First impressions: this approach looks good. I haven't carefully reviewed the changes yet. Adding Johnni ...
8 years, 3 months ago (2012-09-19 05:25:26 UTC) #2
kasperl
I haven't looked closely at the details of how you compute the library in all ...
8 years, 3 months ago (2012-09-19 05:59:17 UTC) #3
ahe
On 2012/09/19 05:59:17, kasperl wrote: > I think we should start using selectors for looking ...
8 years, 3 months ago (2012-09-19 06:11:01 UTC) #4
karlklose
LGTM. Thank you for doing this, Alexander. As Kasper said, using selectors would be nicer. ...
8 years, 3 months ago (2012-09-19 06:49:20 UTC) #5
aam-me
8 years, 3 months ago (2012-09-19 11:48:22 UTC) #6
aam-me
Thank you, guys, for the feedback! I will look into changing ClassElement.lookupConstructor(LibraryElement fromLibrary, SourceString className, ...
8 years, 3 months ago (2012-09-19 11:50:40 UTC) #7
aam-me
Please, take a look at lookupConstructor Selector-related changes when you have a chance. Could very ...
8 years, 3 months ago (2012-09-19 23:37:30 UTC) #8
kasperl
Thanks a lot for working on this, Alexander -- and sorry for the long response ...
8 years, 3 months ago (2012-09-21 12:12:06 UTC) #9
aam-me
Kasper, thank you for the review. I might have misunderstood how Selectors supposed to handle ...
8 years, 3 months ago (2012-09-21 12:34:18 UTC) #10
aam-me
Here are the responses to the comments I intended to send with the message. https://chromiumcodereview.appspot.com/10947024/diff/11001/lib/compiler/implementation/elements/elements.dart ...
8 years, 3 months ago (2012-09-21 12:35:27 UTC) #11
kasperl
Thanks, Alexander. I should be available for a quick chat next week. For now, I'll ...
8 years, 3 months ago (2012-09-21 13:15:04 UTC) #12
aam-me
Thank you for detailed response, Kasper. I think it does make sense and I uploaded ...
8 years, 3 months ago (2012-09-22 19:27:05 UTC) #13
kasperl
LGTM. Having looked through your code, I think it would be better to get rid ...
8 years, 3 months ago (2012-09-24 05:52:38 UTC) #14
ahe
I'm not sure about this. The string manipulation concerns me. I think it is error ...
8 years, 3 months ago (2012-09-24 06:43:31 UTC) #15
aam-me
Thank you for the feedback! Let me try again. https://chromiumcodereview.appspot.com/10947024/diff/17002/lib/compiler/implementation/universe/universe.dart File lib/compiler/implementation/universe/universe.dart (right): https://chromiumcodereview.appspot.com/10947024/diff/17002/lib/compiler/implementation/universe/universe.dart#newcode132 lib/compiler/implementation/universe/universe.dart:132: ...
8 years, 3 months ago (2012-09-24 13:08:20 UTC) #16
aam-me
Please, take a look again when you have a chance. I removed "string-heavy" logic from ...
8 years, 2 months ago (2012-09-25 04:15:18 UTC) #17
kasperl
Sorry that I haven't made any (real) progress on reviewing this, Alexander -- I've been ...
8 years, 2 months ago (2012-09-28 08:48:54 UTC) #18
ahe
We will soon get rid of the "default class" feature. This means that we don't ...
8 years, 2 months ago (2012-09-28 10:22:52 UTC) #19
Lasse Reichstein Nielsen
We have slightly more than two interfaces left (String and List requires VM changes that ...
8 years, 2 months ago (2012-09-28 10:29:44 UTC) #20
Lasse Reichstein Nielsen
FYI: My not-quite-complete patch for String/List is https://codereview.chromium.org/10942025
8 years, 2 months ago (2012-09-28 10:43:40 UTC) #21
aam-me
Yes, Peter, this makes perfect sense to me. I will start looking at Lasse's changelist ...
8 years, 2 months ago (2012-09-28 11:28:28 UTC) #22
aam-me
Peter, Karl, Johnni, we talked yesterday about getting rid of normalizedName from Selector. This seems ...
8 years, 2 months ago (2012-10-05 12:52:43 UTC) #23
kasperl
https://codereview.chromium.org/10947024/diff/35002/lib/compiler/implementation/elements/elements.dart File lib/compiler/implementation/elements/elements.dart (right): https://codereview.chromium.org/10947024/diff/35002/lib/compiler/implementation/elements/elements.dart#newcode1409 lib/compiler/implementation/elements/elements.dart:1409: Element result = localLookup(selector.normalizedConstructorName); Can't you construct the normalized ...
8 years, 2 months ago (2012-10-08 08:06:40 UTC) #24
ahe
https://codereview.chromium.org/10947024/diff/35002/lib/compiler/implementation/resolver.dart File lib/compiler/implementation/resolver.dart (left): https://codereview.chromium.org/10947024/diff/35002/lib/compiler/implementation/resolver.dart#oldcode217 lib/compiler/implementation/resolver.dart:217: name = new SourceString(constructor.name.slowToString().replaceFirst( It is code like this ...
8 years, 2 months ago (2012-10-08 08:25:43 UTC) #25
aam-me
Peter, please, find quick reply to your suggestion below. Thanks! https://codereview.chromium.org/10947024/diff/35002/lib/compiler/implementation/resolver.dart File lib/compiler/implementation/resolver.dart (right): https://codereview.chromium.org/10947024/diff/35002/lib/compiler/implementation/resolver.dart#newcode239 ...
8 years, 2 months ago (2012-10-08 15:03:35 UTC) #26
ahe
https://codereview.chromium.org/10947024/diff/35002/lib/compiler/implementation/resolver.dart File lib/compiler/implementation/resolver.dart (right): https://codereview.chromium.org/10947024/diff/35002/lib/compiler/implementation/resolver.dart#newcode239 lib/compiler/implementation/resolver.dart:239: constructor.defaultImplementation = defaultClass.lookupConstructor( On 2012/10/08 15:03:35, aam wrote: > ...
8 years, 2 months ago (2012-10-08 16:35:52 UTC) #27
aam-me
Thank you for all your feedback! normalizedConstructorName is gone. Please, take another look. https://chromiumcodereview.appspot.com/10947024/diff/35002/lib/compiler/implementation/elements/elements.dart File ...
8 years, 2 months ago (2012-10-09 04:08:42 UTC) #28
kasperl
LGTM. https://codereview.chromium.org/10947024/diff/46001/lib/compiler/implementation/elements/elements.dart File lib/compiler/implementation/elements/elements.dart (right): https://codereview.chromium.org/10947024/diff/46001/lib/compiler/implementation/elements/elements.dart#newcode1426 lib/compiler/implementation/elements/elements.dart:1426: (constructorName.slowToString() != className.slowToString()))) { Shouldn't this be indented ...
8 years, 2 months ago (2012-10-09 13:56:02 UTC) #29
aam-me
Thank you, Kasper, for the review! Please take another look when you have a chance. ...
8 years, 2 months ago (2012-10-10 00:22:40 UTC) #30
kasperl
Still LGTM! Thanks for taking the time to work through all our comments, Alexander. https://chromiumcodereview.appspot.com/10947024/diff/38010/lib/compiler/implementation/universe/universe.dart ...
8 years, 2 months ago (2012-10-10 08:20:01 UTC) #31
ahe
LGTM! All nits below. Perhaps you should land this and address any follow-up questions in ...
8 years, 2 months ago (2012-10-11 04:55:40 UTC) #32
aam-me
Thank you, Peter, for the comments. I have incorporated changes you suggested. Please, take a ...
8 years, 2 months ago (2012-10-11 06:14:00 UTC) #33
ahe
8 years, 2 months ago (2012-10-11 07:14:46 UTC) #34
LGTM!

https://codereview.chromium.org/10947024/diff/38010/lib/compiler/implementati...
File lib/compiler/implementation/elements/elements.dart (right):

https://codereview.chromium.org/10947024/diff/38010/lib/compiler/implementati...
lib/compiler/implementation/elements/elements.dart:1477: [Element
noMatch(Element)]) {
On 2012/10/11 06:14:00, aam wrote:
> Some users of lookupFactoryConstructor just check return result for null to
> determine whether there was a match.
> Would you recommend always use noMatch function instead?

I would probably prefer to not have the nomatch function at all. But that
depends on the performance impact.

In general, I think we have a tendency to overuse optional arguments in the
compiler. When there are less than a handful of callers of a method, I don't
think it helps making stuff optional.

Powered by Google App Engine
This is Rietveld 408576698