[heap] Add GCTracer::Scopes for prologue and epilogue in safepoint

Bug: v8:10315
Change-Id: I70f62b5bc3856163aba2672149876b185fc20c00
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2346277
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69389}
This commit is contained in:
Dominik Inführ 2020-08-11 10:06:47 +02:00 committed by Commit Bot
parent 2d0cad7c3a
commit 5ca316b364
2 changed files with 9 additions and 4 deletions

View File

@ -847,6 +847,7 @@ void Heap::GarbageCollectionPrologue() {
}
void Heap::GarbageCollectionPrologueInSafepoint() {
TRACE_GC(tracer(), GCTracer::Scope::HEAP_PROLOGUE_SAFEPOINT);
gc_count_++;
UpdateNewSpaceAllocationCounter();
@ -1086,6 +1087,8 @@ void Heap::DeoptMarkedAllocationSites() {
}
void Heap::GarbageCollectionEpilogueInSafepoint() {
TRACE_GC(tracer(), GCTracer::Scope::HEAP_EPILOGUE_SAFEPOINT);
#define UPDATE_COUNTERS_FOR_SPACE(space) \
isolate_->counters()->space##_bytes_available()->Set( \
static_cast<int>(space()->Available())); \
@ -1129,6 +1132,10 @@ void Heap::GarbageCollectionEpilogueInSafepoint() {
if (FLAG_check_handle_count) CheckHandleCount();
#endif
if (Heap::ShouldZapGarbage() || FLAG_clear_free_memory) {
ZapFromSpace();
}
{
TRACE_GC(tracer(), GCTracer::Scope::HEAP_EPILOGUE_REDUCE_NEW_SPACE);
ReduceNewSpaceSize();
@ -1137,10 +1144,6 @@ void Heap::GarbageCollectionEpilogueInSafepoint() {
void Heap::GarbageCollectionEpilogue() {
TRACE_GC(tracer(), GCTracer::Scope::HEAP_EPILOGUE);
if (Heap::ShouldZapGarbage() || FLAG_clear_free_memory) {
ZapFromSpace();
}
AllowHeapAllocation for_the_rest_of_the_epilogue;
UpdateMaximumCommitted();

View File

@ -418,10 +418,12 @@
F(HEAP_EMBEDDER_TRACING_EPILOGUE) \
F(HEAP_EPILOGUE) \
F(HEAP_EPILOGUE_REDUCE_NEW_SPACE) \
F(HEAP_EPILOGUE_SAFEPOINT) \
F(HEAP_EXTERNAL_EPILOGUE) \
F(HEAP_EXTERNAL_PROLOGUE) \
F(HEAP_EXTERNAL_WEAK_GLOBAL_HANDLES) \
F(HEAP_PROLOGUE) \
F(HEAP_PROLOGUE_SAFEPOINT) \
TOP_MC_SCOPES(F) \
F(MC_CLEAR_DEPENDENT_CODE) \
F(MC_CLEAR_FLUSHABLE_BYTECODE) \