Commit 55979fb0 authored by Omer Katz's avatar Omer Katz Committed by Commit Bot

heap: Fix some statistics scopes

Some of the scopes were not reporting any data to GC metrics.
This CL replaces Scope with EnabledScope to fix these issues.

Bug: 986235
Change-Id: I21a8884faa491aa21b8d6a88e716c870f911da1f
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1995320Reviewed-by: default avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#730177}
parent 59f77eec
...@@ -268,7 +268,7 @@ Address BaseArena::LazySweep(size_t allocation_size, size_t gc_info_index) { ...@@ -268,7 +268,7 @@ Address BaseArena::LazySweep(size_t allocation_size, size_t gc_info_index) {
if (GetThreadState()->SweepForbidden()) if (GetThreadState()->SweepForbidden())
return nullptr; return nullptr;
ThreadHeapStatsCollector::Scope stats_scope( ThreadHeapStatsCollector::EnabledScope stats_scope(
GetThreadState()->Heap().stats_collector(), GetThreadState()->Heap().stats_collector(),
ThreadHeapStatsCollector::kLazySweepOnAllocation); ThreadHeapStatsCollector::kLazySweepOnAllocation);
ThreadState::SweepForbiddenScope sweep_forbidden(GetThreadState()); ThreadState::SweepForbiddenScope sweep_forbidden(GetThreadState());
......
...@@ -1620,7 +1620,7 @@ void ThreadState::MarkPhasePrologue(BlinkGC::CollectionType collection_type, ...@@ -1620,7 +1620,7 @@ void ThreadState::MarkPhasePrologue(BlinkGC::CollectionType collection_type,
} }
void ThreadState::MarkPhaseVisitRoots() { void ThreadState::MarkPhaseVisitRoots() {
ThreadHeapStatsCollector::Scope stats_scope( ThreadHeapStatsCollector::EnabledScope stats_scope(
Heap().stats_collector(), ThreadHeapStatsCollector::kVisitRoots); Heap().stats_collector(), ThreadHeapStatsCollector::kVisitRoots);
Visitor* visitor = current_gc_data_.visitor.get(); Visitor* visitor = current_gc_data_.visitor.get();
......
...@@ -124,7 +124,7 @@ bool UnifiedHeapController::AdvanceTracing(double deadline_in_ms) { ...@@ -124,7 +124,7 @@ bool UnifiedHeapController::AdvanceTracing(double deadline_in_ms) {
ThreadHeapStatsCollector::BlinkGCInV8Scope nested_scope( ThreadHeapStatsCollector::BlinkGCInV8Scope nested_scope(
thread_state_->Heap().stats_collector()); thread_state_->Heap().stats_collector());
if (!thread_state_->in_atomic_pause()) { if (!thread_state_->in_atomic_pause()) {
ThreadHeapStatsCollector::Scope advance_tracing_scope( ThreadHeapStatsCollector::EnabledScope advance_tracing_scope(
thread_state_->Heap().stats_collector(), thread_state_->Heap().stats_collector(),
ThreadHeapStatsCollector::kUnifiedMarkingStep); ThreadHeapStatsCollector::kUnifiedMarkingStep);
// V8 calls into embedder tracing from its own marking to ensure // V8 calls into embedder tracing from its own marking to ensure
......
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