|
1 | 1 | #include "node_internals.h"
|
2 | 2 | #include "async_wrap.h"
|
| 3 | +#include "v8-profiler.h" |
3 | 4 | #include "node_buffer.h"
|
4 | 5 | #include "node_platform.h"
|
5 | 6 | #include "node_file.h"
|
@@ -73,15 +74,6 @@ IsolateData::IsolateData(Isolate* isolate,
|
73 | 74 | IsolateData::~IsolateData() {
|
74 | 75 | if (platform_ != nullptr)
|
75 | 76 | platform_->UnregisterIsolate(this);
|
76 |
| - if (cpu_profiler_ != nullptr) |
77 |
| - cpu_profiler_->Dispose(); |
78 |
| -} |
79 |
| - |
80 |
| -v8::CpuProfiler* IsolateData::GetCpuProfiler() { |
81 |
| - if (cpu_profiler_ != nullptr) return cpu_profiler_; |
82 |
| - cpu_profiler_ = v8::CpuProfiler::New(isolate()); |
83 |
| - CHECK_NOT_NULL(cpu_profiler_); |
84 |
| - return cpu_profiler_; |
85 | 77 | }
|
86 | 78 |
|
87 | 79 |
|
@@ -260,12 +252,12 @@ void Environment::CleanupHandles() {
|
260 | 252 | void Environment::StartProfilerIdleNotifier() {
|
261 | 253 | uv_prepare_start(&idle_prepare_handle_, [](uv_prepare_t* handle) {
|
262 | 254 | Environment* env = ContainerOf(&Environment::idle_prepare_handle_, handle);
|
263 |
| - env->isolate_data()->GetCpuProfiler()->SetIdle(true); |
| 255 | + env->isolate()->GetCpuProfiler()->SetIdle(true); |
264 | 256 | });
|
265 | 257 |
|
266 | 258 | uv_check_start(&idle_check_handle_, [](uv_check_t* handle) {
|
267 | 259 | Environment* env = ContainerOf(&Environment::idle_check_handle_, handle);
|
268 |
| - env->isolate_data()->GetCpuProfiler()->SetIdle(false); |
| 260 | + env->isolate()->GetCpuProfiler()->SetIdle(false); |
269 | 261 | });
|
270 | 262 | }
|
271 | 263 |
|
|
0 commit comments