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

Issue 10537025: Prototype re-compiling methods in dart2js (Closed)

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

Description

Prototype re-compiling methods in dart2js This is a prototype with the ability for dart2js to retry the compilation of a method after everything has been compiled once. Information collected during the first compilation can then be used when retrying the compilation. During compilation information on whether setters are used on specific fields is collected. When compilation is retried and there are no setters for a field it is treated as if it was declared final. As this is a prototype there are some issues we need to discuss, e.g. * The two queues should probably be generalized some way - maybe with listeners on specific changes to the collected information * Throwing Pass2BailoutException when retrying compilation is a bit of a hack. We should probably not try to retry something we can't. * Where to store the imformation collected during compilation This is one way of improving Delta Blue with 25-30%. R=ahe@google.com, ngeoffray@google.com, kasperl@google.com, ager@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=8647

Patch Set 1 #

Total comments: 8

Patch Set 2 : Created a datastructure for representing "queue2" #

Total comments: 2

Patch Set 3 : Addressed review comments from ager@ #

Total comments: 8

Patch Set 4 : Use setters unformation from universe #

Patch Set 5 : Rebased #

Patch Set 6 : Minor fixes #

Patch Set 7 : Added comment #

Total comments: 8

Patch Set 8 : Addressed review comments #

Patch Set 9 : Use the results from the resolver when trying to detect final fields #

Total comments: 11
Unified diffs Side-by-side diffs Delta from patch set Stats (+103 lines, -4 lines) Patch
M lib/compiler/implementation/compiler.dart View 1 2 3 4 5 6 7 8 6 chunks +27 lines, -0 lines 4 comments Download
M lib/compiler/implementation/enqueue.dart View 1 2 3 4 5 6 7 5 chunks +51 lines, -1 line 7 comments Download
M lib/compiler/implementation/ssa/optimize.dart View 1 2 3 4 5 6 7 8 3 chunks +25 lines, -3 lines 0 comments Download

Messages

Total messages: 14 (0 generated)
Søren Gjesse
8 years, 6 months ago (2012-06-06 13:55:47 UTC) #1
ricow1
DBC https://chromiumcodereview.appspot.com/10537025/diff/1/lib/compiler/implementation/compiler.dart File lib/compiler/implementation/compiler.dart (right): https://chromiumcodereview.appspot.com/10537025/diff/1/lib/compiler/implementation/compiler.dart#newcode390 lib/compiler/implementation/compiler.dart:390: WorkItem work = world.queue2.removeLast(); should we remove it ...
8 years, 6 months ago (2012-06-07 06:35:49 UTC) #2
Mads Ager (google)
I think this looks promising. https://chromiumcodereview.appspot.com/10537025/diff/1/lib/compiler/implementation/world.dart File lib/compiler/implementation/world.dart (right): https://chromiumcodereview.appspot.com/10537025/diff/1/lib/compiler/implementation/world.dart#newcode76 lib/compiler/implementation/world.dart:76: Set<SourceString> setters = I ...
8 years, 6 months ago (2012-06-07 07:56:21 UTC) #3
Søren Gjesse
Refactored "queue2" into datastructure. Addressed review comments. https://chromiumcodereview.appspot.com/10537025/diff/1/lib/compiler/implementation/compiler.dart File lib/compiler/implementation/compiler.dart (right): https://chromiumcodereview.appspot.com/10537025/diff/1/lib/compiler/implementation/compiler.dart#newcode390 lib/compiler/implementation/compiler.dart:390: WorkItem work ...
8 years, 6 months ago (2012-06-07 08:06:12 UTC) #4
floitsch
LGTM. https://chromiumcodereview.appspot.com/10537025/diff/8001/lib/compiler/implementation/enqueue.dart File lib/compiler/implementation/enqueue.dart (right): https://chromiumcodereview.appspot.com/10537025/diff/8001/lib/compiler/implementation/enqueue.dart#newcode28 lib/compiler/implementation/enqueue.dart:28: void add(Element element, [TreeElements elements]) { not that ...
8 years, 6 months ago (2012-06-07 10:59:39 UTC) #5
Søren Gjesse
PTAL This is now cleaned up and rebased to ToT. https://chromiumcodereview.appspot.com/10537025/diff/8001/lib/compiler/implementation/enqueue.dart File lib/compiler/implementation/enqueue.dart (right): https://chromiumcodereview.appspot.com/10537025/diff/8001/lib/compiler/implementation/enqueue.dart#newcode28 ...
8 years, 6 months ago (2012-06-13 10:55:09 UTC) #6
floitsch
LGTM. https://chromiumcodereview.appspot.com/10537025/diff/13001/lib/compiler/implementation/enqueue.dart File lib/compiler/implementation/enqueue.dart (right): https://chromiumcodereview.appspot.com/10537025/diff/13001/lib/compiler/implementation/enqueue.dart#newcode91 lib/compiler/implementation/enqueue.dart:91: void addToRecompilationCandidates(Element element, [TreeElements elements]) { maybe addRecompilationCandidate ...
8 years, 6 months ago (2012-06-13 12:51:10 UTC) #7
ngeoffray
https://chromiumcodereview.appspot.com/10537025/diff/13001/lib/compiler/implementation/ssa/optimize.dart File lib/compiler/implementation/ssa/optimize.dart (right): https://chromiumcodereview.appspot.com/10537025/diff/13001/lib/compiler/implementation/ssa/optimize.dart#newcode588 lib/compiler/implementation/ssa/optimize.dart:588: !compiler.codegenWorld.hasInvokedSetter(field, compiler) && Why don't you just use the ...
8 years, 6 months ago (2012-06-13 22:02:26 UTC) #8
Søren Gjesse
https://chromiumcodereview.appspot.com/10537025/diff/13001/lib/compiler/implementation/enqueue.dart File lib/compiler/implementation/enqueue.dart (right): https://chromiumcodereview.appspot.com/10537025/diff/13001/lib/compiler/implementation/enqueue.dart#newcode91 lib/compiler/implementation/enqueue.dart:91: void addToRecompilationCandidates(Element element, [TreeElements elements]) { On 2012/06/13 12:51:10, ...
8 years, 6 months ago (2012-06-14 06:37:10 UTC) #9
Søren Gjesse
As discussed offline used the universe from the resolver to check for fields which are ...
8 years, 6 months ago (2012-06-14 08:31:27 UTC) #10
ngeoffray
LGTM! https://chromiumcodereview.appspot.com/10537025/diff/7003/lib/compiler/implementation/compiler.dart File lib/compiler/implementation/compiler.dart (right): https://chromiumcodereview.appspot.com/10537025/diff/7003/lib/compiler/implementation/compiler.dart#newcode172 lib/compiler/implementation/compiler.dart:172: int pass = 1; This field name is ...
8 years, 6 months ago (2012-06-14 12:42:24 UTC) #11
ahe
https://chromiumcodereview.appspot.com/10537025/diff/7003/lib/compiler/implementation/compiler.dart File lib/compiler/implementation/compiler.dart (right): https://chromiumcodereview.appspot.com/10537025/diff/7003/lib/compiler/implementation/compiler.dart#newcode553 lib/compiler/implementation/compiler.dart:553: log('Compiled ${codegenWorld.generatedCode.length} methods.'); I think you may have broken ...
8 years, 6 months ago (2012-06-14 13:23:54 UTC) #12
Søren Gjesse
Final comments addressed in https://chromiumcodereview.appspot.com/10532158. https://chromiumcodereview.appspot.com/10537025/diff/7003/lib/compiler/implementation/compiler.dart File lib/compiler/implementation/compiler.dart (right): https://chromiumcodereview.appspot.com/10537025/diff/7003/lib/compiler/implementation/compiler.dart#newcode172 lib/compiler/implementation/compiler.dart:172: int pass = 1; ...
8 years, 6 months ago (2012-06-15 09:25:02 UTC) #13
ngeoffray
8 years, 6 months ago (2012-06-15 20:06:14 UTC) #14
https://chromiumcodereview.appspot.com/10537025/diff/7003/lib/compiler/implem...
File lib/compiler/implementation/enqueue.dart (right):

https://chromiumcodereview.appspot.com/10537025/diff/7003/lib/compiler/implem...
lib/compiler/implementation/enqueue.dart:92: // Only member functions can be
recompiled. An exception to this is members
On 2012/06/15 09:25:02, Søren Gjesse wrote:
> On 2012/06/14 12:42:24, ngeoffray wrote:
> > Why not static methods?
> 
> Doesn't isMember cover static functions as well? And top level functions which
> have enclosingClass null?

you are right that isMember covers static functions, but it does not cover top
level functions.

Powered by Google App Engine
This is Rietveld 408576698