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

Issue 8700008: New approach to Crankshaft decision-making (Closed)

Created:
9 years ago by Jakob Kummerow
Modified:
8 years, 9 months ago
Reviewers:
fschneider, danno
CC:
v8-dev, Kevin Millikin (Chromium)
Visibility:
Public.

Description

New approach to Crankshaft decision-making - make the profiler consider IC patching - variable tick interval on ARM/MIPS - primitive functions trigger their optimization themselves Obsoleted/replaced by a series of other CLs.

Patch Set 1 #

Patch Set 2 : fix snapshot build and memory leaks #

Total comments: 2

Patch Set 3 : fix function self-optimization; address first comment #

Total comments: 13

Patch Set 4 : address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+258 lines, -167 lines) Patch
M src/api.cc View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/arm/full-codegen-arm.cc View 1 2 3 1 chunk +26 lines, -0 lines 0 comments Download
M src/compiler.h View 1 2 1 chunk +3 lines, -0 lines 0 comments Download
M src/full-codegen.cc View 1 1 chunk +3 lines, -0 lines 0 comments Download
M src/heap.cc View 1 2 3 2 chunks +1 line, -1 line 0 comments Download
M src/ia32/full-codegen-ia32.cc View 1 2 3 1 chunk +25 lines, -0 lines 0 comments Download
M src/ic.cc View 1 1 chunk +3 lines, -0 lines 0 comments Download
M src/ic-inl.h View 1 2 3 2 chunks +17 lines, -0 lines 0 comments Download
M src/isolate.h View 1 2 chunks +11 lines, -0 lines 0 comments Download
M src/isolate.cc View 1 1 chunk +2 lines, -1 line 0 comments Download
M src/log.h View 1 2 chunks +1 line, -6 lines 0 comments Download
M src/log.cc View 1 chunk +5 lines, -0 lines 0 comments Download
M src/mark-compact.cc View 1 3 chunks +4 lines, -7 lines 0 comments Download
M src/objects.h View 1 2 3 3 chunks +8 lines, -3 lines 0 comments Download
M src/objects-inl.h View 1 2 3 1 chunk +3 lines, -0 lines 0 comments Download
M src/platform.h View 1 1 chunk +1 line, -0 lines 0 comments Download
M src/platform-cygwin.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M src/platform-freebsd.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M src/platform-linux.cc View 1 2 3 6 chunks +34 lines, -2 lines 0 comments Download
M src/platform-macos.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M src/platform-openbsd.cc View 1 chunk +6 lines, -0 lines 0 comments Download
M src/platform-solaris.cc View 1 chunk +7 lines, -0 lines 0 comments Download
M src/platform-win32.cc View 1 1 chunk +6 lines, -0 lines 0 comments Download
M src/runtime.cc View 1 2 3 1 chunk +2 lines, -0 lines 0 comments Download
M src/runtime-profiler.h View 1 2 3 3 chunks +11 lines, -20 lines 0 comments Download
M src/runtime-profiler.cc View 1 2 3 10 chunks +34 lines, -127 lines 0 comments Download
M src/x64/full-codegen-x64.cc View 1 2 3 1 chunk +26 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Jakob Kummerow
First version. Building with snapshot is currently broken. This depends on the definition of "primitive" ...
9 years ago (2011-11-25 16:51:14 UTC) #1
Jakob Kummerow
OK, I think this is really ready for review now :-) Review guidance: The most ...
9 years ago (2011-12-06 13:59:07 UTC) #2
danno
One comment from a quick first pass http://codereview.chromium.org/8700008/diff/3001/src/platform-linux.cc File src/platform-linux.cc (right): http://codereview.chromium.org/8700008/diff/3001/src/platform-linux.cc#newcode1114 src/platform-linux.cc:1114: if (tick_count_ ...
9 years ago (2011-12-07 13:21:52 UTC) #3
Jakob Kummerow
http://codereview.chromium.org/8700008/diff/3001/src/platform-linux.cc File src/platform-linux.cc (right): http://codereview.chromium.org/8700008/diff/3001/src/platform-linux.cc#newcode1114 src/platform-linux.cc:1114: if (tick_count_ == 5) { On 2011/12/07 13:21:52, danno ...
9 years ago (2011-12-12 10:02:38 UTC) #4
fschneider
Here is my first comments: http://codereview.chromium.org/8700008/diff/9001/src/ia32/full-codegen-ia32.cc File src/ia32/full-codegen-ia32.cc (right): http://codereview.chromium.org/8700008/diff/9001/src/ia32/full-codegen-ia32.cc#newcode136 src/ia32/full-codegen-ia32.cc:136: info->function()->is_primitive() && What is ...
9 years ago (2011-12-12 11:31:21 UTC) #5
fschneider
http://codereview.chromium.org/8700008/diff/9001/src/ia32/full-codegen-ia32.cc File src/ia32/full-codegen-ia32.cc (right): http://codereview.chromium.org/8700008/diff/9001/src/ia32/full-codegen-ia32.cc#newcode135 src/ia32/full-codegen-ia32.cc:135: if (FLAG_crankshaft && If a function has optimization disabled ...
9 years ago (2011-12-13 11:53:00 UTC) #6
Jakob Kummerow
9 years ago (2011-12-14 08:42:31 UTC) #7
New patch set uploaded that addresses comments.

Moving the profiler_ticks field to SharedFunctionInfo might affect performance;
proper testing is currently blocked on an unrelated bug that is triggered when
running earley-boyer.

http://codereview.chromium.org/8700008/diff/9001/src/ia32/full-codegen-ia32.cc
File src/ia32/full-codegen-ia32.cc (right):

http://codereview.chromium.org/8700008/diff/9001/src/ia32/full-codegen-ia32.c...
src/ia32/full-codegen-ia32.cc:135: if (FLAG_crankshaft &&
On 2011/12/13 11:53:01, fschneider wrote:
> If a function has optimization disabled via DisableOptimization() because we
> can't optimize it or we deoptimized frequently, we should not add code for
> counting.

Done.

http://codereview.chromium.org/8700008/diff/9001/src/ia32/full-codegen-ia32.c...
src/ia32/full-codegen-ia32.cc:136: info->function()->is_primitive() &&
On 2011/12/12 11:31:21, fschneider wrote:
> What is a primitive function? I can't find the source code for this predicate.

Basically a function that doesn't contain loops, calls, or un-inline-able
statements. The definition is in http://codereview.chromium.org/8677008/

http://codereview.chromium.org/8700008/diff/9001/src/objects.h
File src/objects.h (right):

http://codereview.chromium.org/8700008/diff/9001/src/objects.h#newcode5464
src/objects.h:5464: inline int profiler_ticks();
On 2011/12/13 11:53:01, fschneider wrote:
> On 2011/12/12 11:31:21, fschneider wrote:
> > Shouldn't be this on SharedFunctionInfo instead?
> 
> This increases the size of each JSFunction by 1 word  from 36 to 40 (11%).
This
> could hurt memory-constrained devices on programs with lots of closures. I'd
> prefer a solution without additional space cost.
> 

Done.

http://codereview.chromium.org/8700008/diff/9001/src/runtime-profiler.cc
File src/runtime-profiler.cc (left):

http://codereview.chromium.org/8700008/diff/9001/src/runtime-profiler.cc#oldc...
src/runtime-profiler.cc:59: static const int kSizeLimit = 1500;
On 2011/12/12 11:31:21, fschneider wrote:
> The reason for looking at the size in some form was that large functions are
> more expensive to optimize, so we want to be sure they're worth optimizing by
> requiring more profiler ticks. The metric used is maybe not ideal, but some
form
> of taking size into account would be still useful. It seemed to help on ia32.

I see the reasoning and agree in principle, but with the new approach I haven't
been able to measure any benefit to considering the function size.

http://codereview.chromium.org/8700008/diff/9001/src/runtime-profiler.cc
File src/runtime-profiler.cc (right):

http://codereview.chromium.org/8700008/diff/9001/src/runtime-profiler.cc#newc...
src/runtime-profiler.cc:82: PrintF(" for recompilation, reason: %d", reason);
On 2011/12/13 11:53:01, fschneider wrote:
> Print reason in English instead of just a number.

Done.

http://codereview.chromium.org/8700008/diff/9001/src/runtime-profiler.cc#newc...
src/runtime-profiler.cc:163: Optimize(function, 1);
On 2011/12/13 11:53:01, fschneider wrote:
> Name instead of an integer constant?

Done.

Powered by Google App Engine
This is Rietveld 408576698