5#ifndef V8_LOGGING_RUNTIME_CALL_STATS_SCOPE_H_
6#define V8_LOGGING_RUNTIME_CALL_STATS_SCOPE_H_
19#ifdef V8_RUNTIME_CALL_STATS
22#define RCS_SCOPE(...) \
23 v8::internal::RuntimeCallTimerScope CONCAT(rcs_timer_scope, \
24 __LINE__)(__VA_ARGS__)
26RuntimeCallTimerScope::RuntimeCallTimerScope(Isolate* isolate,
27 RuntimeCallCounterId counter_id) {
28 if (
V8_LIKELY(!TracingFlags::is_runtime_stats_enabled()))
return;
29 stats_ = isolate->counters()->runtime_call_stats();
30 stats_->Enter(&
timer_, counter_id);
33RuntimeCallTimerScope::RuntimeCallTimerScope(
34 LocalIsolate* isolate, RuntimeCallCounterId counter_id,
35 RuntimeCallStats::CounterMode mode) {
36 if (
V8_LIKELY(!TracingFlags::is_runtime_stats_enabled()))
return;
38 stats_ = isolate->runtime_call_stats();
39 if (mode == RuntimeCallStats::CounterMode::kThreadSpecific) {
40 counter_id = stats_->CounterIdForThread(counter_id);
43 DCHECK(stats_->IsCounterAppropriateForThread(counter_id));
44 stats_->Enter(&
timer_, counter_id);
base::ElapsedTimer timer_
#define DCHECK_NOT_NULL(val)
#define DCHECK(condition)
#define V8_LIKELY(condition)