Chromium Code Reviews| Index: src/heap/heap-inl.h |
| diff --git a/src/heap/heap-inl.h b/src/heap/heap-inl.h |
| index c6185c6e30d3bcd31ae231fe192263dfae8bca5b..c7991c122a9e8243476003f66cb820b034dc09f9 100644 |
| --- a/src/heap/heap-inl.h |
| +++ b/src/heap/heap-inl.h |
| @@ -257,20 +257,21 @@ void Heap::OnAllocationEvent(HeapObject* object, int size_in_bytes) { |
| profiler->AllocationEvent(object->address(), size_in_bytes); |
| } |
| - ++allocations_count_; |
| - |
| if (FLAG_verify_predictable) { |
| + ++allocations_count_; |
|
ulan
2015/11/12 11:38:15
Why the increment is conditional now?
Igor Sheludko
2015/11/12 11:53:30
We use allocations_count only for --verify-predict
|
| + // Advance synthetic time by making a time request. |
| + MonotonicallyIncreasingTimeInMs(); |
| + |
| UpdateAllocationsHash(object); |
| UpdateAllocationsHash(size_in_bytes); |
| - if ((FLAG_dump_allocations_digest_at_alloc > 0) && |
| - (--dump_allocations_hash_countdown_ == 0)) { |
| - dump_allocations_hash_countdown_ = FLAG_dump_allocations_digest_at_alloc; |
| + if (allocations_count_ % FLAG_dump_allocations_digest_at_alloc == 0) { |
| PrintAlloctionsHash(); |
| } |
| } |
| if (FLAG_trace_allocation_stack_interval > 0) { |
| + if (!FLAG_verify_predictable) ++allocations_count_; |
| if (allocations_count_ % FLAG_trace_allocation_stack_interval == 0) { |
| isolate()->PrintStack(stdout, Isolate::kPrintStackConcise); |
| } |
| @@ -292,14 +293,31 @@ void Heap::OnMoveEvent(HeapObject* target, HeapObject* source, |
| if (FLAG_verify_predictable) { |
| ++allocations_count_; |
| + // Advance synthetic time by making a time request. |
| + MonotonicallyIncreasingTimeInMs(); |
| UpdateAllocationsHash(source); |
| UpdateAllocationsHash(target); |
| UpdateAllocationsHash(size_in_bytes); |
| - if ((FLAG_dump_allocations_digest_at_alloc > 0) && |
| - (--dump_allocations_hash_countdown_ == 0)) { |
| - dump_allocations_hash_countdown_ = FLAG_dump_allocations_digest_at_alloc; |
| + if (allocations_count_ % FLAG_dump_allocations_digest_at_alloc == 0) { |
| + PrintAlloctionsHash(); |
| + } |
| + } |
| +} |
| + |
| + |
| +void Heap::OnFreeEvent(Address start, int size_in_bytes) { |
| + if (FLAG_verify_predictable) { |
| + HeapObject* object = HeapObject::FromAddress(start); |
| + ++allocations_count_; |
| + // Advance synthetic time by making a time request. |
| + MonotonicallyIncreasingTimeInMs(); |
| + |
| + UpdateAllocationsHash(object); |
| + UpdateAllocationsHash(size_in_bytes); |
| + |
| + if (allocations_count_ % FLAG_dump_allocations_digest_at_alloc == 0) { |
| PrintAlloctionsHash(); |
| } |
| } |