https://codereview.chromium.org/424973004/diff/40001/src/cpu-profiler.cc
File src/cpu-profiler.cc (right):

https://codereview.chromium.org/424973004/diff/40001/src/cpu-profiler.cc#newcode260
src/cpu-profiler.cc:260: ASSERT(Script::cast(shared->script()));
On 2014/08/11 13:11:50, Denis Pravdin wrote:
On 2014/08/11 12:18:15, alph wrote:
> nit: DCHECK here and everywhere else.
>
> Also cast does SLOW_DCHECK internally.
> Anyway if you still want to do the check here, it's better to use:
> DCHECK(shared->script()->IsScript());

DCHECK is undefined. Do you suggest to use the CHECK macro?

Rebaseline to the latest version. They've been introduced a couple weeks
ago.

https://codereview.chromium.org/424973004/diff/40001/src/profile-generator.cc
File src/profile-generator.cc (right):

https://codereview.chromium.org/424973004/diff/40001/src/profile-generator.cc#newcode226
src/profile-generator.cc:226: e->value = static_cast<char*>(e->value) +
1;
On 2014/08/11 13:00:13, Denis Pravdin wrote:
On 2014/08/11 12:18:15, alph wrote:
> should be cast to uintptr_t

e->value is type of void* and used as a hit counter. To increment it
by 1 void*
should be casted to char* but not uintptr*. otherwise it will be
incremented by
sizeof(int).

I didn't say uintptr*, I said uintptr_t :-)
uintptr_t is an integer type having a size of the platform pointer. The
cast to char* does also work, but it looks like a trick relying on the
fact sizeof(char) is 1.

I meant to use the following snippet to be strictly correct with types:
e->value = reinterpret_cast<void*>(reinterpret_cast<uintptr_t>(e->value)
+ 1);

https://codereview.chromium.org/424973004/

--
--
v8-dev mailing list
[email protected]
http://groups.google.com/group/v8-dev
--- You received this message because you are subscribed to the Google Groups "v8-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to