Commit 5ab55557 authored by JianxiaoLuIntel's avatar JianxiaoLuIntel Committed by V8 LUCI CQ

[heap] gc_count manully add 1 in prologue callback

To make sure print the correct gc_count in heap layout tracer.

Change-Id: I790d9359acab188bbfd1f59b731531c58713d8f1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/3361842
Auto-Submit: Jianxiao Lu <jianxiao.lu@intel.com>
Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Jianxiao Lu <jianxiao.lu@intel.com>
Cr-Commit-Position: refs/heads/main@{#78575}
parent c4ebb5dc
......@@ -20,7 +20,8 @@ void HeapLayoutTracer::GCProloguePrintHeapLayout(v8::Isolate* isolate,
v8::GCCallbackFlags flags,
void* data) {
Heap* heap = reinterpret_cast<i::Isolate*>(isolate)->heap();
PrintF("Before GC:%d,", heap->gc_count());
// gc_count_ will increase after this callback, manually add 1.
PrintF("Before GC:%d,", heap->gc_count() + 1);
PrintF("collector_name:%s\n", Heap::CollectorName(gc_type));
PrintHeapLayout(std::cout, heap);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment