Commit 21ea6019 authored by Alexei Filippov's avatar Alexei Filippov Committed by Commit Bot

[runtime-call-stats] Fix NPE in RuntimeCallStats::Dump

The runtime_call_stats_ can be NULL on a worker thread when RCS
are enabled dynamically.

BUG=v8:7043

Change-Id: I1d26ae76c46955e017c82037b4a015ad86ba2f77
Reviewed-on: https://chromium-review.googlesource.com/755419Reviewed-by: 's avatarCamillo Bruni <cbruni@chromium.org>
Reviewed-by: 's avatarAdam Klein <adamk@chromium.org>
Commit-Queue: Alexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#49245}
parent ae5bc7c2
......@@ -3505,8 +3505,9 @@ void Parser::ParseOnBackground(ParseInfo* info) {
if (result != nullptr) *info->cached_data() = logger.GetScriptData();
log_ = nullptr;
}
if (FLAG_runtime_stats &
v8::tracing::TracingCategoryObserver::ENABLED_BY_TRACING) {
if (runtime_call_stats_ &&
(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"),
......
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