5#ifndef V8_HEAP_GC_TRACER_INL_H_
6#define V8_HEAP_GC_TRACER_INL_H_
32 thread_kind_(thread_kind),
37#ifdef V8_RUNTIME_CALL_STATS
38 if (
V8_LIKELY(!TracingFlags::is_runtime_stats_enabled()))
return;
41 runtime_stats_->Enter(&
timer_, GCTracer::RCSCounterFromScope(scope));
43 runtime_call_stats_scope_.emplace(
44 tracer->worker_thread_runtime_call_stats());
45 runtime_stats_ = runtime_call_stats_scope_->Get();
46 runtime_stats_->Enter(&
timer_, GCTracer::RCSCounterFromScope(scope));
53 tracer_->AddScopeSample(
scope_, duration);
56 if (
scope_ == ScopeId::MC_INCREMENTAL ||
57 scope_ == ScopeId::MC_INCREMENTAL_START) {
58 auto* long_task_stats =
59 tracer_->heap_->isolate_->GetCurrentLongTaskStats();
60 long_task_stats->gc_full_incremental_wall_clock_duration_us +=
65#ifdef V8_RUNTIME_CALL_STATS
66 if (
V8_LIKELY(runtime_stats_ ==
nullptr))
return;
67 runtime_stats_->Leave(&
timer_);
74 return "V8.GC_" #scope;
99 return id - FIRST_INCREMENTAL_SCOPE;
104 return type == Type::SCAVENGER || type == Type::MINOR_MARK_SWEEPER ||
105 type == Type::INCREMENTAL_MINOR_MARK_SWEEPER;
136#ifdef V8_RUNTIME_CALL_STATS
141RuntimeCallCounterId GCTracer::RCSCounterFromScope(
Scope::ScopeId id) {
143 return static_cast<RuntimeCallCounterId
>(
144 static_cast<int>(RuntimeCallCounterId::kGC_MC_INCREMENTAL) +
145 static_cast<int>(id));
double InMillisecondsF() const
int64_t InMicroseconds() const
WorkerThreadRuntimeCallStats * worker_thread_runtime_call_stats()
RuntimeCallStats * runtime_call_stats()
static V8_INLINE constexpr bool IsYoungGenerationEvent(Type type)
base::TimeDelta scopes[Scope::NUMBER_OF_SCOPES]
V8_INLINE Scope(GCTracer *tracer, ScopeId scope, ThreadKind thread_kind)
@ FIRST_INCREMENTAL_SCOPE
static constexpr bool NeedsYoungEpoch(ScopeId id)
const ThreadKind thread_kind_
static constexpr int IncrementalOffset(ScopeId id)
static constexpr const char * Name(ScopeId id)
base::TimeDelta background_scopes_[Scope::NUMBER_OF_SCOPES]
V8_INLINE void AddScopeSample(Scope::ScopeId id, base::TimeDelta duration)
V8_INLINE double current_scope(Scope::ScopeId id) const
V8_INLINE CollectionEpoch CurrentEpoch(Scope::ScopeId id) const
CollectionEpoch epoch_full_
V8_INLINE constexpr const IncrementalInfos & incremental_scope(Scope::ScopeId id) const
base::Mutex background_scopes_mutex_
CollectionEpoch epoch_young_
IncrementalInfos incremental_scopes_[Scope::NUMBER_OF_INCREMENTAL_SCOPES]
bool IsMainThread() const
DeclarationScope * scope_
#define TRACER_YOUNG_EPOCH_SCOPES(F)
#define TRACER_BACKGROUND_SCOPES(F)
base::ElapsedTimer timer_
base::TimeTicks start_time_
#define DCHECK_LE(v1, v2)
#define DCHECK_IMPLIES(v1, v2)
#define DCHECK_NE(v1, v2)
#define DCHECK_GE(v1, v2)
#define DCHECK_GT(v1, v2)
constexpr V8_INLINE IncrementalInfos & operator+=(base::TimeDelta delta)
base::TimeDelta longest_step
#define V8_LIKELY(condition)