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

Issue 10534109: Use simple loop tracking instead of size to determine if (Closed)

Created:
8 years, 6 months ago by Mads Ager (google)
Modified:
8 years, 6 months ago
Reviewers:
ngeoffray
CC:
reviews_dartlang.org
Visibility:
Public.

Description

Use simple loop tracking instead of size to determine if speculative type assumptions should be used. This seems like a better indication of hotness than the previous size + use count estimate. R=ngeoffray@google.com BUG= TEST= Committed: https://code.google.com/p/dart/source/detail?r=8538

Patch Set 1 #

Patch Set 2 : Add comment. #

Total comments: 4

Patch Set 3 : Address comments. #

Total comments: 6

Patch Set 4 : Address next round of comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+26 lines, -21 lines) Patch
M lib/compiler/implementation/ssa/bailout.dart View 1 3 chunks +5 lines, -20 lines 0 comments Download
M lib/compiler/implementation/ssa/builder.dart View 1 2 3 3 chunks +11 lines, -0 lines 0 comments Download
M lib/compiler/implementation/ssa/codegen.dart View 1 2 3 1 chunk +9 lines, -1 line 0 comments Download
M lib/compiler/implementation/ssa/nodes.dart View 1 chunk +1 line, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
Mads Ager (google)
8 years, 6 months ago (2012-06-12 07:56:57 UTC) #1
ngeoffray
Indeed, looks like a much better heuristic. There are a few things to change in ...
8 years, 6 months ago (2012-06-12 09:17:40 UTC) #2
Mads Ager (google)
Thanks for the comments Nicolas! Please take another look. https://chromiumcodereview.appspot.com/10534109/diff/2001/lib/compiler/implementation/elements/elements.dart File lib/compiler/implementation/elements/elements.dart (right): https://chromiumcodereview.appspot.com/10534109/diff/2001/lib/compiler/implementation/elements/elements.dart#newcode544 lib/compiler/implementation/elements/elements.dart:544: ...
8 years, 6 months ago (2012-06-12 11:01:56 UTC) #3
ngeoffray
LGTM, but I think you should take the whole selector (the Selector class), instead of ...
8 years, 6 months ago (2012-06-12 11:11:09 UTC) #4
Mads Ager (google)
8 years, 6 months ago (2012-06-12 11:24:21 UTC) #5
Thanks!

https://chromiumcodereview.appspot.com/10534109/diff/8/lib/compiler/implement...
File lib/compiler/implementation/ssa/builder.dart (right):

https://chromiumcodereview.appspot.com/10534109/diff/8/lib/compiler/implement...
lib/compiler/implementation/ssa/builder.dart:144: final Set<SourceString>
selectorsCalledInLoop;
On 2012/06/12 11:11:09, ngeoffray wrote:
> I think this should be a Map<SourceString, Selector>, so that you only
optimize
> a method that can actually be hit by the call in a loop (eg matches the number
> of arugments, or is of the right type, or ...).

Another good point. Done!

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

https://chromiumcodereview.appspot.com/10534109/diff/8/lib/compiler/implement...
lib/compiler/implementation/ssa/codegen.dart:1610: var inLoop =
node.block.enclosingLoopHeader !== null;
On 2012/06/12 11:11:09, ngeoffray wrote:
> var -> bool

Done.

https://chromiumcodereview.appspot.com/10534109/diff/8/lib/compiler/implement...
lib/compiler/implementation/ssa/codegen.dart:1615:
backend.builder.functionsCalledInLoop.add(node.element);
On 2012/06/12 11:11:09, ngeoffray wrote:
> You should store the optimized selector (line 1624) instead. See my comment in
> builder.dart.

Done.

Powered by Google App Engine
This is Rietveld 408576698