Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(230)

Unified Diff: src/heap/heap-inl.h

Issue 1104353003: Add flag to print stack-trace after n allocations. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: trace stack for allocations Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/flag-definitions.h ('k') | src/isolate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap-inl.h
diff --git a/src/heap/heap-inl.h b/src/heap/heap-inl.h
index 12c46069eb52ccc9054f075edcff49c62bed5cb4..38deb1f31df4c49b8325dd79a04e4ce813116e72 100644
--- a/src/heap/heap-inl.h
+++ b/src/heap/heap-inl.h
@@ -213,9 +213,9 @@ void Heap::OnAllocationEvent(HeapObject* object, int size_in_bytes) {
profiler->AllocationEvent(object->address(), size_in_bytes);
}
- if (FLAG_verify_predictable) {
- ++allocations_count_;
+ ++allocations_count_;
+ if (FLAG_verify_predictable) {
UpdateAllocationsHash(object);
UpdateAllocationsHash(size_in_bytes);
@@ -225,6 +225,12 @@ void Heap::OnAllocationEvent(HeapObject* object, int size_in_bytes) {
PrintAlloctionsHash();
}
}
+
+ if (FLAG_trace_allocation_stack_interval > 0) {
+ if (allocations_count_ % FLAG_trace_allocation_stack_interval == 0) {
+ isolate()->PrintStack(stdout, Isolate::kPrintStackConcise);
+ }
+ }
}
« no previous file with comments | « src/flag-definitions.h ('k') | src/isolate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698