I would propose to turn off allocation folding when you turn on object
tracking
and vice versa. FLAG_use_allocation_folding = false
Doing that will give you all the objects with corresponding sizes.
https://codereview.chromium.org/22852024/diff/84001/src/heap-snapshot-generator.cc
File src/heap-snapshot-generator.cc (right):
https://codereview.chromium.org/22852024/diff/84001/src/heap-snapshot-generator.cc#newcode447
src/heap-snapshot-generator.cc:447: FindOrAddEntry(addr, size, false);
On 2013/10/03 16:27:55, Alexandra Mikhaylova wrote:
On 2013/10/02 18:00:29, Hannes Payer wrote:
> Why do we have two implementations of the same functions?
Sometimes we want just to update the information (the size) of the
object that
has already been tracked. This works pretty much the same as
reqistering a new
object, but one more call of NewObjectEvent (and NewObject) can
confuse other
developers, so we decided to create separate methods for it.
For example, here
https://codereview.chromium.org/22852024/diff/84001/src/heap.cc both
an object
and its allocation memento are allocated in one go. So then we track
the
allocation memento as a new object and adjust information about the
size of the
original object itself.
Since both functions implement the same functionality, it should really
be just one function. Let's find a more abstract name for the function.
We could call it CreateOrUpdateObjectSize which would be similar to
FindOrAddEntry...
https://codereview.chromium.org/22852024/diff/84001/src/heap.cc
File src/heap.cc (right):
https://codereview.chromium.org/22852024/diff/84001/src/heap.cc#newcode4979
src/heap.cc:4979: HeapProfiler* profiler = isolate()->heap_profiler();
On 2013/10/03 16:27:55, Alexandra Mikhaylova wrote:
On 2013/10/02 18:20:04, Hannes Payer wrote:
> On 2013/10/02 18:00:29, Hannes Payer wrote:
> > Why do you track the allocation of the memento separately? And why
don't you
> > account the allocation in the if branch before?
> Ok, ignore question two, because you allocate using AllocateRaw. But
why do
you
> track the memento separately?
The memento is treated as a separate HeapObject when the heap is being
iterated,
so if we don't track it, we'll have untracked allocations.
OK. You could also ignore the mementos since they are VM specific and
never visible to the user. Mementos allocated in optimized code are
allocated together with their parent object, so you cannot track them.
They are manually folded into the parent object.
https://codereview.chromium.org/22852024/diff/84001/test/cctest/test-heap-profiler.cc
File test/cctest/test-heap-profiler.cc (right):
https://codereview.chromium.org/22852024/diff/84001/test/cctest/test-heap-profiler.cc#newcode2010
test/cctest/test-heap-profiler.cc:2010: // This is an example of using
checking of JS allocations tracking in a test.
On 2013/10/03 16:27:55, Alexandra Mikhaylova wrote:
On 2013/10/02 18:00:29, Hannes Payer wrote:
> Either remove the test if it is not testing anything or add a proper
test. I
> would prefer adding a proper test.
This test checks that we don't miss some simplest allocations and
HeapObjectsTracker works correctly. In the HeapObjectsTracker
constructor,
allocations tracking is switched on. In the destructor, allocations
tracking is
checked and untracked objects are found (if any).
Sure, but wouldn't it make sense to check which objects are found?
https://codereview.chromium.org/22852024/
--
--
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/groups/opt_out.