https://chromiumcodereview.appspot.com/10037004/diff/2001/src/profile-generator.cc File src/profile-generator.cc (right):
https://chromiumcodereview.appspot.com/10037004/diff/2001/src/profile-generator.cc#newcode3477 src/profile-generator.cc:3477: List<HeapEntry*>& nodes = *(snapshot_->entries()); On 2012/04/11 05:20:05, Yury Semikhatsky wrote:
Consider extracting this loop in a separate method.
Done. https://chromiumcodereview.appspot.com/10037004/diff/2001/src/profile-generator.cc#newcode3621 src/profile-generator.cc:3621: writer_->AddString(JSON_O( On 2012/04/10 22:28:09, Mikhail Naganov (Chromium) wrote:
Is this object still the first item of 'nodes' array? This is
asymmetric to the
absence of such meta-information in 'edges' array. Perhaps, we should
reserve
the first item of 'edges' for this data? This will also eliminate the
special
case of the item 0. It is not necessary to split the meta-data in this changelist.
moved meta info to the snapshot object. https://chromiumcodereview.appspot.com/10037004/diff/2001/src/profile-generator.cc#newcode3621 src/profile-generator.cc:3621: writer_->AddString(JSON_O( On 2012/04/11 05:20:05, Yury Semikhatsky wrote:
On 2012/04/10 22:28:09, Mikhail Naganov (Chromium) wrote: > Is this object still the first item of 'nodes' array? This is
asymmetric to
the > absence of such meta-information in 'edges' array. Perhaps, we
should reserve
> the first item of 'edges' for this data? This will also eliminate
the special
> case of the item 0. It is not necessary to split the meta-data in
this
> changelist.
I'd rather put the array length at the first item in both cases. This
way we can
preallocate array of required size from the very beginning.
Added node and edges count to the snapshot info. https://chromiumcodereview.appspot.com/10037004/diff/2001/src/profile-generator.cc#newcode3624 src/profile-generator.cc:3624: JSON_S("type") "," On 2012/04/10 22:28:09, Mikhail Naganov (Chromium) wrote:
Why are you moving commas to the suffix position? I supposed, having
them as a
prefix makes you only to change a single line when adding / removing a
field. Unless this it the first field. :-) So in this sense none of prefix and postfix commas wins. But IMO the postfix commas are more readable because fields of the same object have the same padding. https://chromiumcodereview.appspot.com/10037004/diff/2001/test/cctest/test-heap-profiler.cc File test/cctest/test-heap-profiler.cc (right): https://chromiumcodereview.appspot.com/10037004/diff/2001/test/cctest/test-heap-profiler.cc#newcode632 test/cctest/test-heap-profiler.cc:632: "parsed.nodes = parsed.nodes.slice(1);\n" On 2012/04/10 22:28:09, Mikhail Naganov (Chromium) wrote:
Why is this needed?
it's not needed anymore. I removed the meta node from nodes array. https://chromiumcodereview.appspot.com/10037004/ -- v8-dev mailing list [email protected] http://groups.google.com/group/v8-dev
