Commit 5ca316b3 authored by Dominik Inführ's avatar Dominik Inführ Committed by Commit Bot

[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/+/2346277Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Cr-Commit-Position: refs/heads/master@{#69389}
parent 2d0cad7c
...@@ -847,6 +847,7 @@ void Heap::GarbageCollectionPrologue() { ...@@ -847,6 +847,7 @@ void Heap::GarbageCollectionPrologue() {
} }
void Heap::GarbageCollectionPrologueInSafepoint() { void Heap::GarbageCollectionPrologueInSafepoint() {
TRACE_GC(tracer(), GCTracer::Scope::HEAP_PROLOGUE_SAFEPOINT);
gc_count_++; gc_count_++;
UpdateNewSpaceAllocationCounter(); UpdateNewSpaceAllocationCounter();
...@@ -1086,6 +1087,8 @@ void Heap::DeoptMarkedAllocationSites() { ...@@ -1086,6 +1087,8 @@ void Heap::DeoptMarkedAllocationSites() {
} }
void Heap::GarbageCollectionEpilogueInSafepoint() { void Heap::GarbageCollectionEpilogueInSafepoint() {
TRACE_GC(tracer(), GCTracer::Scope::HEAP_EPILOGUE_SAFEPOINT);
#define UPDATE_COUNTERS_FOR_SPACE(space) \ #define UPDATE_COUNTERS_FOR_SPACE(space) \
isolate_->counters()->space##_bytes_available()->Set( \ isolate_->counters()->space##_bytes_available()->Set( \
static_cast<int>(space()->Available())); \ static_cast<int>(space()->Available())); \
...@@ -1129,6 +1132,10 @@ void Heap::GarbageCollectionEpilogueInSafepoint() { ...@@ -1129,6 +1132,10 @@ void Heap::GarbageCollectionEpilogueInSafepoint() {
if (FLAG_check_handle_count) CheckHandleCount(); if (FLAG_check_handle_count) CheckHandleCount();
#endif #endif
if (Heap::ShouldZapGarbage() || FLAG_clear_free_memory) {
ZapFromSpace();
}
{ {
TRACE_GC(tracer(), GCTracer::Scope::HEAP_EPILOGUE_REDUCE_NEW_SPACE); TRACE_GC(tracer(), GCTracer::Scope::HEAP_EPILOGUE_REDUCE_NEW_SPACE);
ReduceNewSpaceSize(); ReduceNewSpaceSize();
...@@ -1137,10 +1144,6 @@ void Heap::GarbageCollectionEpilogueInSafepoint() { ...@@ -1137,10 +1144,6 @@ void Heap::GarbageCollectionEpilogueInSafepoint() {
void Heap::GarbageCollectionEpilogue() { void Heap::GarbageCollectionEpilogue() {
TRACE_GC(tracer(), GCTracer::Scope::HEAP_EPILOGUE); TRACE_GC(tracer(), GCTracer::Scope::HEAP_EPILOGUE);
if (Heap::ShouldZapGarbage() || FLAG_clear_free_memory) {
ZapFromSpace();
}
AllowHeapAllocation for_the_rest_of_the_epilogue; AllowHeapAllocation for_the_rest_of_the_epilogue;
UpdateMaximumCommitted(); UpdateMaximumCommitted();
......
...@@ -418,10 +418,12 @@ ...@@ -418,10 +418,12 @@
F(HEAP_EMBEDDER_TRACING_EPILOGUE) \ F(HEAP_EMBEDDER_TRACING_EPILOGUE) \
F(HEAP_EPILOGUE) \ F(HEAP_EPILOGUE) \
F(HEAP_EPILOGUE_REDUCE_NEW_SPACE) \ F(HEAP_EPILOGUE_REDUCE_NEW_SPACE) \
F(HEAP_EPILOGUE_SAFEPOINT) \
F(HEAP_EXTERNAL_EPILOGUE) \ F(HEAP_EXTERNAL_EPILOGUE) \
F(HEAP_EXTERNAL_PROLOGUE) \ F(HEAP_EXTERNAL_PROLOGUE) \
F(HEAP_EXTERNAL_WEAK_GLOBAL_HANDLES) \ F(HEAP_EXTERNAL_WEAK_GLOBAL_HANDLES) \
F(HEAP_PROLOGUE) \ F(HEAP_PROLOGUE) \
F(HEAP_PROLOGUE_SAFEPOINT) \
TOP_MC_SCOPES(F) \ TOP_MC_SCOPES(F) \
F(MC_CLEAR_DEPENDENT_CODE) \ F(MC_CLEAR_DEPENDENT_CODE) \
F(MC_CLEAR_FLUSHABLE_BYTECODE) \ F(MC_CLEAR_FLUSHABLE_BYTECODE) \
......
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