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

Issue 6879108: Expose optimization info via runtime functions (Closed)

Created:
9 years, 8 months ago by Jakob Kummerow
Modified:
9 years, 6 months ago
Reviewers:
Mike West, danno
CC:
v8-dev
Visibility:
Public.

Description

Expose optimization info via runtime functions TEST=mjsunit/assert-opt-and-deopt.js Committed: http://code.google.com/p/v8/source/detail?r=7813

Patch Set 1 #

Patch Set 2 : fix --stress-opt, --nocrankshaft, --always-opt #

Total comments: 12

Patch Set 3 : address comments #

Unified diffs Side-by-side diffs Delta from patch set Stats (+206 lines, -0 lines) Patch
M src/runtime.h View 1 2 1 chunk +2 lines, -0 lines 0 comments Download
M src/runtime.cc View 1 2 1 chunk +23 lines, -0 lines 0 comments Download
A test/mjsunit/assert-opt-and-deopt.js View 1 2 1 chunk +181 lines, -0 lines 0 comments Download

Messages

Total messages: 7 (0 generated)
Jakob Kummerow
Does this satisfy your requirements? I'm happy to implement another approach if you feel there's ...
9 years, 8 months ago (2011-04-21 10:53:42 UTC) #1
danno
LGTM.
9 years, 7 months ago (2011-04-28 17:27:51 UTC) #2
Jakob Kummerow
I had to extend this quite a bit to make it work with the --stress-opt, ...
9 years, 7 months ago (2011-05-03 08:13:25 UTC) #3
Jakob Kummerow
Mike: please take a look at the .js file.
9 years, 7 months ago (2011-05-04 07:42:52 UTC) #4
danno
Non-JS LGTM with suggested name change. http://codereview.chromium.org/6879108/diff/2001/src/runtime.cc File src/runtime.cc (right): http://codereview.chromium.org/6879108/diff/2001/src/runtime.cc#newcode7427 src/runtime.cc:7427: RUNTIME_FUNCTION(MaybeObject*, Runtime_IsOptimizedFunction) { ...
9 years, 7 months ago (2011-05-04 07:47:04 UTC) #5
Mike West
LGTM with nits. http://codereview.chromium.org/6879108/diff/2001/test/mjsunit/assert-opt-and-deopt.js File test/mjsunit/assert-opt-and-deopt.js (right): http://codereview.chromium.org/6879108/diff/2001/test/mjsunit/assert-opt-and-deopt.js#newcode38 test/mjsunit/assert-opt-and-deopt.js:38: this.NEVER = 4; Nit: These can ...
9 years, 7 months ago (2011-05-04 08:18:02 UTC) #6
Jakob Kummerow
9 years, 7 months ago (2011-05-06 15:58:15 UTC) #7
Thanks for the comments; I finally got around to addressing them.
I'll land this on Monday morning.

http://codereview.chromium.org/6879108/diff/2001/src/runtime.cc
File src/runtime.cc (right):

http://codereview.chromium.org/6879108/diff/2001/src/runtime.cc#newcode7427
src/runtime.cc:7427: RUNTIME_FUNCTION(MaybeObject*, Runtime_IsOptimizedFunction)
{
On 2011/05/04 07:47:04, danno wrote:
> Perhaps this should be called FunctionOptimizationStatus

Done.

http://codereview.chromium.org/6879108/diff/2001/test/mjsunit/assert-opt-and-...
File test/mjsunit/assert-opt-and-deopt.js (right):

http://codereview.chromium.org/6879108/diff/2001/test/mjsunit/assert-opt-and-...
test/mjsunit/assert-opt-and-deopt.js:38: this.NEVER = 4;
On 2011/05/04 08:18:03, Mike West wrote:
> Nit: These can be pulled out into a static member of `OptTracker`, and would
> probably be best as a separate enum.  See
>
http://codesearch.google.com/codesearch/p?vert=chromium#OAMlx_jo-ck/src/chrom...
> for an example.

Done.

http://codereview.chromium.org/6879108/diff/2001/test/mjsunit/assert-opt-and-...
test/mjsunit/assert-opt-and-deopt.js:39: this.opt_counts_ = new Object();
On 2011/05/04 08:18:03, Mike West wrote:
> Nit: Object literals (`{}`) are preferred.

Done.

http://codereview.chromium.org/6879108/diff/2001/test/mjsunit/assert-opt-and-...
test/mjsunit/assert-opt-and-deopt.js:52: return;
On 2011/05/04 08:18:03, Mike West wrote:
> Nit: If asserts are disabled, you should probably return `true` here;
otherwise
> you're returning `undefined`, which evaluates to `false`.  `if
> (tracker.AssertOptCount(x, y))` would fail...

This function doesn't have a return value in any case. It's not supposed to be
used inside if() conditionals. The same is true for all OptTracker.Assert*
functions.

http://codereview.chromium.org/6879108/diff/2001/test/mjsunit/assert-opt-and-...
test/mjsunit/assert-opt-and-deopt.js:77: if (raw_optimized == this.ALWAYS ||
On 2011/05/04 08:18:03, Mike West wrote:
> Nit: Use `DisableAsserts_`.

Done.

http://codereview.chromium.org/6879108/diff/2001/test/mjsunit/assert-opt-and-...
test/mjsunit/assert-opt-and-deopt.js:155: for (var i = 0; i < 5; i++) f("a");
On 2011/05/04 08:18:03, Mike West wrote:
> Nit: You're intentionally switching from numbers to strings here, and it's
> almost certainly clear to V8 developers that the optimizations are
> type-specific.  It wasn't clear to me, though... A comment would still be
nice.
> :)

Done.

Powered by Google App Engine
This is Rietveld 408576698