Commit 9a537778 authored by Alexei Filippov's avatar Alexei Filippov Committed by Commit Bot

[cpu profiler] Make profiler work even if enabled before isolate creation.

TracingCpuProfiler wrapper uses API interrupt to start the profiling
on the Isolate thread. However it could do it before Isolate is
initialized, so the interrupt it requested got lost.

The patch moves TracingCpuProfiler creation after ThreadLocal object
for isolate is initialized.

BUG=v8:8247

Change-Id: I5b0b3d18e017396f9860faeab909abbfab4616df
Reviewed-on: https://chromium-review.googlesource.com/1252762Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Commit-Queue: Alexei Filippov <alph@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56324}
parent 6f59af6d
......@@ -2538,8 +2538,6 @@ Isolate::Isolate()
InitializeLoggingAndCounters();
debug_ = new Debug(this);
tracing_cpu_profiler_.reset(new TracingCpuProfilerImpl(this));
init_memcopy_functions();
if (FLAG_embedded_builtins) {
......@@ -3011,6 +3009,10 @@ bool Isolate::Init(StartupDeserializer* des) {
InitializeThreadLocal();
// Profiler has to be created after ThreadLocal is initialized
// because it makes use of interrupts.
tracing_cpu_profiler_.reset(new TracingCpuProfilerImpl(this));
bootstrapper_->Initialize(create_heap_objects);
if (FLAG_embedded_builtins) {
......
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