Reviewers: Mads Ager, jkummerow,
Message:
Hi,
I just implemented a prototype for exposing counters in D8. I did it
similar to
the way the OS object is exposed.
Rather than merely a CL, this is also a request for comment.
Currently, there are two methods counter.get(counter_name) and
counter.names().
Is that sufficient? Any better interface?
Concerning test case d8-counter.js: the way how the counters for Math.tan
and
Math.sin turn out differently is puzzling.
Cheers,
Yang
http://codereview.chromium.org/7281007/diff/1/src/d8.cc
File src/d8.cc (right):
http://codereview.chromium.org/7281007/diff/1/src/d8.cc#newcode601
src/d8.cc:601:
Add new object "counter".
http://codereview.chromium.org/7281007/diff/1/src/d8.cc#newcode612
src/d8.cc:612:
counter.get() returns the counter by the name provided.
e.g.
counter.get("c:V8.TotalCompiledCodeSize")
http://codereview.chromium.org/7281007/diff/1/src/d8.cc#newcode628
src/d8.cc:628:
counter.names() returns counter names as an array of strings.
http://codereview.chromium.org/7281007/diff/1/src/d8.cc#newcode655
src/d8.cc:655: MapCounters(i::FLAG_map_counters);
Init counter in any case (not only upon --dump-counters). This makes
unit tests take less than half a second longer in total, so I think this
is acceptable.
http://codereview.chromium.org/7281007/diff/1/test/mjsunit/d8-counter.js
File test/mjsunit/d8-counter.js (right):
http://codereview.chromium.org/7281007/diff/1/test/mjsunit/d8-counter.js#newcode62
test/mjsunit/d8-counter.js:62:
surprisingly, c:V8.MathSin and c:V8.MathCos both receive the value 1,
while c:V8.MathTan ends up with 1000... no caching involved here?
Description:
expose counter in d8
TEST=./d8 test/mjsunit/mjsunit.js test/mjsunit/d8-counter.js
Please review this at http://codereview.chromium.org/7281007/
SVN Base: https://v8.googlecode.com/svn/branches/bleeding_edge
Affected files:
M src/d8.h
M src/d8.cc
A test/mjsunit/d8-counter.js
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev