http://codereview.chromium.org/1694011/diff/35007/38002
File include/v8.h (right):

http://codereview.chromium.org/1694011/diff/35007/38002#newcode808
include/v8.h:808: static const int kNotFound;
On 2010/05/03 19:16:02, jaimeyap wrote:
On 2010/05/03 07:59:21, Søren Gjesse wrote:
> In the profiler API this is called CpuProfileNode::kNoLineNumberInfo
and the
> class Message can also return a line number. We should only have one
constant
> for this, and I suggest you place it in the class Message and call
it
> kNoLineNumberInfo. Then update the comment in class Message and make
sure a
> consistent value is returned (either 0 or -1 - I am not sure what
message
does).

I think Message returns -1. But CpuProfileNode and this new StackTrace
API
return 0.

Given that the indexes are all 1-based, I think returning 0 makes most
sense. I
changed them all to use Message::kNoLineNumberOffset, which ==0.

All unit tests pass, so if anyone was depending on this being -1 then
they may
be broken :(.


As for the profiler API, I chose 0 because WebKit uses unsigned ints for
reporting line numbers, so -1 was turning into 2^32 - 1, that isn't
acceptable.

http://codereview.chromium.org/1694011/show

--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev

Reply via email to