Commit 19364326 authored by Omer Katz's avatar Omer Katz Committed by Commit Bot

cppgc: Enable missing scopes

Bug: chromium:1056170
Change-Id: I9151d31a27ed5fc8e8c98b77b2132aaa7ee562e1
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2702334Reviewed-by: 's avatarMichael Lippautz <mlippautz@chromium.org>
Commit-Queue: Omer Katz <omerkatz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72836}
parent 43c775f2
......@@ -484,8 +484,8 @@ bool Compactor::CancelIfShouldNotCompact(
Compactor::CompactableSpaceHandling Compactor::CompactSpacesIfEnabled() {
if (!is_enabled_) return CompactableSpaceHandling::kSweep;
StatsCollector::DisabledScope stats_scope(heap_.heap()->stats_collector(),
StatsCollector::kAtomicCompact);
StatsCollector::EnabledScope stats_scope(heap_.heap()->stats_collector(),
StatsCollector::kAtomicCompact);
MovableReferences movable_references(*heap_.heap());
......
......@@ -290,8 +290,8 @@ void MarkerBase::FinishMarking(MarkingConfig::StackState stack_state) {
void MarkerBase::ProcessWeakness() {
DCHECK_EQ(MarkingConfig::MarkingType::kAtomic, config_.marking_type);
StatsCollector::DisabledScope stats_scope(heap().stats_collector(),
StatsCollector::kAtomicWeak);
StatsCollector::EnabledScope stats_scope(heap().stats_collector(),
StatsCollector::kAtomicWeak);
heap().GetWeakPersistentRegion().Trace(&visitor());
// Processing cross-thread handles requires taking the process lock.
......
......@@ -11,6 +11,7 @@
#include <vector>
#include "include/cppgc/platform.h"
#include "src/base/logging.h"
#include "src/base/macros.h"
#include "src/base/platform/time.h"
#include "src/heap/cppgc/garbage-collector.h"
......@@ -359,6 +360,12 @@ template <StatsCollector::TraceCategory trace_category,
template <typename... Args>
void StatsCollector::InternalScope<trace_category, scope_category>::StartTrace(
Args... args) {
// Top level scopes that contribute to histogram should always be enabled.
DCHECK_IMPLIES(static_cast<int>(scope_id_) <
(scope_category == kMutatorThread
? static_cast<int>(kNumHistogramScopeIds)
: static_cast<int>(kNumHistogramConcurrentScopeIds)),
trace_category == StatsCollector::TraceCategory::kEnabled);
if (trace_category == StatsCollector::TraceCategory::kEnabled)
StartTraceImpl(args...);
}
......
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