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

Issue 10180001: Introduce typed selectors to do better tree shaking based on calls on 'this'. Getters and setters w… (Closed)

Created:
8 years, 8 months ago by ngeoffray
Modified:
8 years, 8 months ago
Reviewers:
floitsch, kasperl
CC:
reviews_dartlang.org, karlklose, Lasse Reichstein Nielsen, ahe
Visibility:
Public.

Description

Introduce typed selectors to do better tree shaking based on calls on 'this'. Getters and setters will be next. Committed: https://code.google.com/p/dart/source/detail?r=6847

Patch Set 1 #

Total comments: 20

Patch Set 2 : #

Patch Set 3 : #

Patch Set 4 : #

Patch Set 5 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+89 lines, -29 lines) Patch
M lib/compiler/implementation/compile_time_constants.dart View 1 chunk +6 lines, -4 lines 0 comments Download
M lib/compiler/implementation/elements/elements.dart View 1 2 1 chunk +14 lines, -0 lines 0 comments Download
M lib/compiler/implementation/emitter.dart View 1 2 1 chunk +1 line, -2 lines 0 comments Download
M lib/compiler/implementation/enqueue.dart View 2 chunks +2 lines, -8 lines 0 comments Download
M lib/compiler/implementation/resolver.dart View 1 chunk +1 line, -3 lines 0 comments Download
M lib/compiler/implementation/ssa/builder.dart View 1 chunk +6 lines, -3 lines 0 comments Download
M lib/compiler/implementation/ssa/codegen.dart View 1 2 3 4 1 chunk +16 lines, -0 lines 0 comments Download
M lib/compiler/implementation/ssa/optimize.dart View 1 chunk +3 lines, -3 lines 0 comments Download
M lib/compiler/implementation/universe.dart View 1 3 chunks +40 lines, -6 lines 0 comments Download

Messages

Total messages: 9 (0 generated)
ngeoffray
8 years, 8 months ago (2012-04-23 12:12:46 UTC) #1
ngeoffray
FYI: from 883250 to 875200 bytes generated for swarm.
8 years, 8 months ago (2012-04-23 12:16:11 UTC) #2
kasperl
https://chromiumcodereview.appspot.com/10180001/diff/1/lib/compiler/implementation/elements/elements.dart File lib/compiler/implementation/elements/elements.dart (right): https://chromiumcodereview.appspot.com/10180001/diff/1/lib/compiler/implementation/elements/elements.dart#newcode850 lib/compiler/implementation/elements/elements.dart:850: * Returns true if [cls] is a subclass of ...
8 years, 8 months ago (2012-04-23 12:34:45 UTC) #3
ahe
FYI https://chromiumcodereview.appspot.com/10180001/diff/1/lib/compiler/implementation/elements/elements.dart File lib/compiler/implementation/elements/elements.dart (right): https://chromiumcodereview.appspot.com/10180001/diff/1/lib/compiler/implementation/elements/elements.dart#newcode850 lib/compiler/implementation/elements/elements.dart:850: * Returns true if [cls] is a subclass ...
8 years, 8 months ago (2012-04-23 12:37:53 UTC) #4
ngeoffray
Thanks for the comments, PTAL http://codereview.chromium.org/10180001/diff/1/lib/compiler/implementation/elements/elements.dart File lib/compiler/implementation/elements/elements.dart (right): http://codereview.chromium.org/10180001/diff/1/lib/compiler/implementation/elements/elements.dart#newcode850 lib/compiler/implementation/elements/elements.dart:850: * Returns true if ...
8 years, 8 months ago (2012-04-23 13:48:18 UTC) #5
floitsch
LGTM. https://chromiumcodereview.appspot.com/10180001/diff/1/lib/compiler/implementation/elements/elements.dart File lib/compiler/implementation/elements/elements.dart (right): https://chromiumcodereview.appspot.com/10180001/diff/1/lib/compiler/implementation/elements/elements.dart#newcode852 lib/compiler/implementation/elements/elements.dart:852: * This method is not to be used ...
8 years, 8 months ago (2012-04-23 13:58:30 UTC) #6
ngeoffray
PTAL https://chromiumcodereview.appspot.com/10180001/diff/1/lib/compiler/implementation/elements/elements.dart File lib/compiler/implementation/elements/elements.dart (right): https://chromiumcodereview.appspot.com/10180001/diff/1/lib/compiler/implementation/elements/elements.dart#newcode852 lib/compiler/implementation/elements/elements.dart:852: * This method is not to be used ...
8 years, 8 months ago (2012-04-23 14:09:32 UTC) #7
floitsch
https://chromiumcodereview.appspot.com/10180001/diff/1/lib/compiler/implementation/ssa/codegen.dart File lib/compiler/implementation/ssa/codegen.dart (right): https://chromiumcodereview.appspot.com/10180001/diff/1/lib/compiler/implementation/ssa/codegen.dart#newcode1034 lib/compiler/implementation/ssa/codegen.dart:1034: Element method = cls.lookupMember(node.name); On 2012/04/23 14:09:33, ngeoffray wrote: ...
8 years, 8 months ago (2012-04-23 15:01:51 UTC) #8
ngeoffray
8 years, 8 months ago (2012-04-23 15:22:47 UTC) #9
Thanks Florian, Kasper and Peter.

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

https://chromiumcodereview.appspot.com/10180001/diff/1/lib/compiler/implement...
lib/compiler/implementation/ssa/codegen.dart:1034: Element method =
cls.lookupMember(node.name);
On 2012/04/23 15:01:51, floitsch wrote:
> On 2012/04/23 14:09:33, ngeoffray wrote:
> > On 2012/04/23 13:58:30, floitsch wrote:
> > > Is this just to reduce the number of typed invocations?
> > 
> > Yes.
> > 
> > > Unless I'm wrong it yields more compiled methods:
> > > class A { foo() => 42; }
> > > class B extends A { ... foo() ... } // => cls = A.
> > > class C extends A { foo() => 499; }
> > > Since C is a subclass of 'cls' (A) we will compile C.foo, even though we
> could
> > > have told that nobody actually invokes it.
> > 
> > Ok, so we need A.foo() to be compiled and actually just set the typed
selector
> > to B. Does that make sense?
> 
> Yes. I think that would be the more "correct" version. However reducing the
> typed invocations might be quite beneficial. For now either version is ok with
> me, but should be documented. If it doesn't cost too much I would prefer to go
> with the one that prunes more first, and only if we have too many different
> typed invocations switch to sharing.
> Note that not sharing also simplifies the code.

Added a comment.

Powered by Google App Engine
This is Rietveld 408576698