| Index: src/parsing/parser.cc
|
| diff --git a/src/parsing/parser.cc b/src/parsing/parser.cc
|
| index 842d3520330f80965b332222072408b5d4f0bdf8..b8c780fc0823cb7f4aad2b85b75581da033fbd66 100644
|
| --- a/src/parsing/parser.cc
|
| +++ b/src/parsing/parser.cc
|
| @@ -3809,8 +3809,6 @@ void Parser::Internalize(Isolate* isolate, Handle<Script> script, bool error) {
|
| v8::tracing::TracingCategoryObserver::ENABLED_BY_NATIVE) {
|
| // Copy over the counters from the background thread to the main counters on
|
| // the isolate.
|
| - // TODO(cbruni,lpy): properly attach the runtime stats to the trace for
|
| - // background parsing.
|
| isolate->counters()->runtime_call_stats()->Add(runtime_call_stats_);
|
| }
|
| }
|
| @@ -3873,9 +3871,13 @@ void Parser::ParseOnBackground(ParseInfo* info) {
|
| if (result != NULL) *info->cached_data() = logger.GetScriptData();
|
| log_ = NULL;
|
| }
|
| - if (FLAG_runtime_stats) {
|
| - // TODO(cbruni,lpy): properly attach the runtime stats to the trace for
|
| - // background parsing.
|
| + if (FLAG_runtime_stats &
|
| + v8::tracing::TracingCategoryObserver::ENABLED_BY_TRACING) {
|
| + auto value = v8::tracing::TracedValue::Create();
|
| + runtime_call_stats_->Dump(value.get());
|
| + TRACE_EVENT_INSTANT1(TRACE_DISABLED_BY_DEFAULT("v8.runtime_stats"),
|
| + "V8.RuntimeStats", TRACE_EVENT_SCOPE_THREAD,
|
| + "runtime-call-stats", std::move(value));
|
| }
|
| }
|
|
|
|
|