| Index: src/heap/gc-tracer.cc
|
| diff --git a/src/heap/gc-tracer.cc b/src/heap/gc-tracer.cc
|
| index 98be41d3693be9e79c2faf20e077f7d13093668f..c58aa9b5ea9738a69f1e57a73aad065c06503235 100644
|
| --- a/src/heap/gc-tracer.cc
|
| +++ b/src/heap/gc-tracer.cc
|
| @@ -24,24 +24,30 @@ static intptr_t CountTotalHolesSize(Heap* heap) {
|
| GCTracer::Scope::Scope(GCTracer* tracer, ScopeId scope)
|
| : tracer_(tracer), scope_(scope) {
|
| start_time_ = tracer_->heap_->MonotonicallyIncreasingTimeInMs();
|
| - // TODO(cbruni): remove once we fully moved to a trace-based system.
|
| - if (FLAG_runtime_call_stats) {
|
| + if (TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_ENABLED()) {
|
| + RuntimeCallStats::Enter(
|
| + tracer_->heap_->isolate()->counters()->tracing_runtime_call_stats(),
|
| + &timer_, &RuntimeCallStats::GC);
|
| + } else if (FLAG_runtime_call_stats) {
|
| + // TODO(cbruni): remove once we fully moved to a trace-based system.
|
| RuntimeCallStats::Enter(
|
| tracer_->heap_->isolate()->counters()->runtime_call_stats(), &timer_,
|
| &RuntimeCallStats::GC);
|
| }
|
| - // TODO(lpy): Add a tracing equivalent for the runtime call stats.
|
| }
|
|
|
| GCTracer::Scope::~Scope() {
|
| tracer_->AddScopeSample(
|
| scope_, tracer_->heap_->MonotonicallyIncreasingTimeInMs() - start_time_);
|
| - // TODO(cbruni): remove once we fully moved to a trace-based system.
|
| - if (FLAG_runtime_call_stats) {
|
| + if (TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_ENABLED()) {
|
| + RuntimeCallStats::Leave(
|
| + tracer_->heap_->isolate()->counters()->tracing_runtime_call_stats(),
|
| + &timer_);
|
| + } else if (FLAG_runtime_call_stats) {
|
| + // TODO(cbruni): remove once we fully moved to a trace-based system.
|
| RuntimeCallStats::Leave(
|
| tracer_->heap_->isolate()->counters()->runtime_call_stats(), &timer_);
|
| }
|
| - // TODO(lpy): Add a tracing equivalent for the runtime call stats.
|
| }
|
|
|
| const char* GCTracer::Scope::Name(ScopeId id) {
|
| @@ -208,12 +214,15 @@ void GCTracer::Start(GarbageCollector collector, const char* gc_reason,
|
| start_time, committed_memory);
|
| heap_->isolate()->counters()->aggregated_memory_heap_used()->AddSample(
|
| start_time, used_memory);
|
| - // TODO(cbruni): remove once we fully moved to a trace-based system.
|
| - if (FLAG_runtime_call_stats) {
|
| + if (TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_ENABLED()) {
|
| + RuntimeCallStats::Enter(
|
| + heap_->isolate()->counters()->tracing_runtime_call_stats(), &timer_,
|
| + &RuntimeCallStats::GC);
|
| + } else if (FLAG_runtime_call_stats) {
|
| + // TODO(cbruni): remove once we fully moved to a trace-based system.
|
| RuntimeCallStats::Enter(heap_->isolate()->counters()->runtime_call_stats(),
|
| &timer_, &RuntimeCallStats::GC);
|
| }
|
| - // TODO(lpy): Add a tracing equivalent for the runtime call stats.
|
| }
|
|
|
| void GCTracer::MergeBaseline(const Event& baseline) {
|
| @@ -314,12 +323,14 @@ void GCTracer::Stop(GarbageCollector collector) {
|
| heap_->PrintShortHeapStatistics();
|
| }
|
|
|
| - // TODO(cbruni): remove once we fully moved to a trace-based system.
|
| - if (FLAG_runtime_call_stats) {
|
| + if (TRACE_EVENT_RUNTIME_CALL_STATS_TRACING_ENABLED()) {
|
| + RuntimeCallStats::Leave(
|
| + heap_->isolate()->counters()->tracing_runtime_call_stats(), &timer_);
|
| + } else if (FLAG_runtime_call_stats) {
|
| + // TODO(cbruni): remove once we fully moved to a trace-based system.
|
| RuntimeCallStats::Leave(heap_->isolate()->counters()->runtime_call_stats(),
|
| &timer_);
|
| }
|
| - // TODO(lpy): Add a tracing equivalent for the runtime call stats.
|
| }
|
|
|
|
|
|
|