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

Issue 10908068: Better tracking of provided types at call sites (Closed)

Created:
8 years, 3 months ago by Søren Gjesse
Modified:
8 years, 3 months ago
Reviewers:
kasperl
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Better tracking of provided types at call sites The tracking of provided types at call sites now take both the type of named arguments from selectors and the type of the defualt values for optional paramters into account. To know the type of the default values for optional parameters the constant expressions for the default values are always compiled before the function. In order to check whether a new selector invalidates the current provided types for a function the default values for the optional parameters needs to be stored with all registered optimized functions. R=kasperl@google.com BUG= Committed: https://code.google.com/p/dart/source/detail?r=11917

Patch Set 1 #

Total comments: 33

Patch Set 2 : Addressed review comments #

Total comments: 12

Patch Set 3 : Addressed second round of comments #

Patch Set 4 : Removed debugging code #

Patch Set 5 : Rebased #

Patch Set 6 : Rebase again #

Unified diffs Side-by-side diffs Delta from patch set Stats (+538 lines, -50 lines) Patch
M lib/compiler/implementation/elements/elements.dart View 2 chunks +9 lines, -1 line 0 comments Download
M lib/compiler/implementation/js_backend/backend.dart View 1 2 3 4 5 12 chunks +146 lines, -39 lines 0 comments Download
M lib/compiler/implementation/ssa/builder.dart View 1 2 3 4 5 2 chunks +35 lines, -0 lines 0 comments Download
M lib/compiler/implementation/universe.dart View 1 2 2 chunks +20 lines, -6 lines 0 comments Download
A tests/compiler/dart2js/backend_htype_list_test.dart View 1 2 1 chunk +247 lines, -0 lines 0 comments Download
M tests/compiler/dart2js/call_site_type_inferer_static_test.dart View 1 chunk +2 lines, -1 line 0 comments Download
M tests/compiler/dart2js/call_site_type_inferer_test.dart View 1 4 chunks +79 lines, -3 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Søren Gjesse
8 years, 3 months ago (2012-09-04 08:38:28 UTC) #1
kasperl
Looks pretty good but I thing you can simplify it a bit. Comments: https://chromiumcodereview.appspot.com/10908068/diff/1/lib/compiler/implementation/js_backend/backend.dart File ...
8 years, 3 months ago (2012-09-04 09:18:45 UTC) #2
Søren Gjesse
PTAL https://chromiumcodereview.appspot.com/10908068/diff/1/lib/compiler/implementation/js_backend/backend.dart File lib/compiler/implementation/js_backend/backend.dart (right): https://chromiumcodereview.appspot.com/10908068/diff/1/lib/compiler/implementation/js_backend/backend.dart#newcode50 lib/compiler/implementation/js_backend/backend.dart:50: void insert(int index, SourceString name, HType type) { ...
8 years, 3 months ago (2012-09-04 14:55:07 UTC) #3
kasperl
LGTM. Very happy to see such great tests! https://chromiumcodereview.appspot.com/10908068/diff/6001/lib/compiler/implementation/js_backend/backend.dart File lib/compiler/implementation/js_backend/backend.dart (right): https://chromiumcodereview.appspot.com/10908068/diff/6001/lib/compiler/implementation/js_backend/backend.dart#newcode191 lib/compiler/implementation/js_backend/backend.dart:191: int ...
8 years, 3 months ago (2012-09-05 07:06:29 UTC) #4
Søren Gjesse
8 years, 3 months ago (2012-09-05 08:02:59 UTC) #5
https://chromiumcodereview.appspot.com/10908068/diff/6001/lib/compiler/implem...
File lib/compiler/implementation/js_backend/backend.dart (right):

https://chromiumcodereview.appspot.com/10908068/diff/6001/lib/compiler/implem...
lib/compiler/implementation/js_backend/backend.dart:191: int next =
selector.positionalArgumentCount;  // Next parameter of interest.
On 2012/09/05 07:06:29, kasperl wrote:
> Maybe add a newline and a new comment that explains how you run through the
> optional parameters (to better break up the fairly long method)?

Done.

https://chromiumcodereview.appspot.com/10908068/diff/6001/lib/compiler/implem...
lib/compiler/implementation/js_backend/backend.dart:337: // Getters have no
parameters.
On 2012/09/05 07:06:29, kasperl wrote:
> Maybe move this up before the slightly weird !isMember check?

Done.

https://chromiumcodereview.appspot.com/10908068/diff/6001/lib/compiler/implem...
File lib/compiler/implementation/universe.dart (right):

https://chromiumcodereview.appspot.com/10908068/diff/6001/lib/compiler/implem...
lib/compiler/implementation/universe.dart:326: StringBuffer result = new
StringBuffer();
On 2012/09/05 07:06:29, kasperl wrote:
> Don't do the allocation of this if namedArgumentCount == 0?

Done.

https://chromiumcodereview.appspot.com/10908068/diff/6001/lib/compiler/implem...
lib/compiler/implementation/universe.dart:328: result.add('[');
On 2012/09/05 07:06:29, kasperl wrote:
> How about not adding [ and ] and just returning "[$result]"?

Done.

https://chromiumcodereview.appspot.com/10908068/diff/6001/lib/compiler/implem...
lib/compiler/implementation/universe.dart:410: String toString() {
On 2012/09/05 07:06:29, kasperl wrote:
> How about getting rid of this and just use the one from the superclass -- and
> add printing of the type up there if it isn't null?

Good point, done.

https://chromiumcodereview.appspot.com/10908068/diff/6001/tests/compiler/dart...
File tests/compiler/dart2js/backend_htype_list_test.dart (right):

https://chromiumcodereview.appspot.com/10908068/diff/6001/tests/compiler/dart...
tests/compiler/dart2js/backend_htype_list_test.dart:51: HTypeList
createHTypeListWithNamed(List<HType> types, List<SourceString> namedArguments) {
On 2012/09/05 07:06:29, kasperl wrote:
> Long lines.

Done.

Powered by Google App Engine
This is Rietveld 408576698