Commit 90569cb0 authored by Alexei Filippov's avatar Alexei Filippov Committed by Commit Bot

[cpu-profiler] Remove deprecated Isolate::GetCpuProfiler method.

Do not create a CPU profiler for each isolate implicitly.

BUG=v8:7070

Cq-Include-Trybots: luci.chromium.try:linux_chromium_rel_ng
Change-Id: I6ddd93c58f56591477d8fe4249103a74b7698904
Reviewed-on: https://chromium-review.googlesource.com/1043449
Commit-Queue: Alexei Filippov <alph@chromium.org>
Reviewed-by: 's avatarYang Guo <yangguo@chromium.org>
Cr-Commit-Position: refs/heads/master@{#53449}
parent b466a99f
......@@ -71,7 +71,6 @@ class BigIntObject;
class Boolean;
class BooleanObject;
class Context;
class CpuProfiler;
class Data;
class Date;
class External;
......@@ -7527,15 +7526,7 @@ class V8_EXPORT Isolate {
HeapProfiler* GetHeapProfiler();
/**
* Returns CPU profiler for this isolate. Will return NULL unless the isolate
* is initialized. It is the embedder's responsibility to stop all CPU
* profiling activities if it has started any.
*/
V8_DEPRECATED("CpuProfiler should be created with CpuProfiler::New call.",
CpuProfiler* GetCpuProfiler());
/**
* Tells the CPU profiler whether the embedder is idle.
* Tells the VM whether the embedder is idle or not.
*/
void SetIdle(bool is_idle);
......
......@@ -8064,13 +8064,6 @@ HeapProfiler* Isolate::GetHeapProfiler() {
return reinterpret_cast<HeapProfiler*>(heap_profiler);
}
CpuProfiler* Isolate::GetCpuProfiler() {
i::CpuProfiler* cpu_profiler =
reinterpret_cast<i::Isolate*>(this)->EnsureCpuProfiler();
return reinterpret_cast<CpuProfiler*>(cpu_profiler);
}
void Isolate::SetIdle(bool is_idle) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
isolate->SetIdle(is_idle);
......
......@@ -44,7 +44,6 @@
#include "src/objects/hash-table-inl.h"
#include "src/objects/module-inl.h"
#include "src/objects/promise-inl.h"
#include "src/profiler/cpu-profiler.h"
#include "src/profiler/tracing-cpu-profiler.h"
#include "src/prototype.h"
#include "src/regexp/regexp-stack.h"
......@@ -2522,7 +2521,6 @@ Isolate::Isolate()
is_tail_call_elimination_enabled_(true),
is_isolate_in_background_(false),
memory_savings_mode_active_(false),
cpu_profiler_(nullptr),
heap_profiler_(nullptr),
code_event_dispatcher_(new CodeEventDispatcher()),
function_entry_hook_(nullptr),
......@@ -2643,10 +2641,6 @@ void Isolate::Deinit() {
PrintF(stdout, "=== Stress deopt counter: %u\n", stress_deopt_count_);
}
if (cpu_profiler_) {
cpu_profiler_->DeleteAllProfiles();
}
// We must stop the logger before we tear down other components.
sampler::Sampler* sampler = logger_->sampler();
if (sampler && sampler->IsActive()) sampler->Stop();
......@@ -2698,9 +2692,6 @@ void Isolate::Deinit() {
delete ast_string_constants_;
ast_string_constants_ = nullptr;
delete cpu_profiler_;
cpu_profiler_ = nullptr;
code_event_dispatcher_.reset();
delete root_index_map_;
......@@ -4065,13 +4056,6 @@ void Isolate::SetIdle(bool is_idle) {
}
}
CpuProfiler* Isolate::EnsureCpuProfiler() {
if (!cpu_profiler_) {
cpu_profiler_ = new CpuProfiler(this);
}
return cpu_profiler_;
}
bool StackLimitCheck::JsHasOverflowed(uintptr_t gap) const {
StackGuard* stack_guard = isolate_->stack_guard();
#ifdef USE_SIMULATOR
......
......@@ -68,7 +68,6 @@ class CompilerDispatcher;
class ContextSlotCache;
class Counters;
class CpuFeatures;
class CpuProfiler;
class Debug;
class DeoptimizerData;
class DescriptorLookupCache;
......@@ -1497,10 +1496,6 @@ class Isolate : private HiddenFactory {
return "";
}
// TODO(alph): Remove along with the deprecated GetCpuProfiler().
friend v8::CpuProfiler* v8::Isolate::GetCpuProfiler();
CpuProfiler* EnsureCpuProfiler();
base::Atomic32 id_;
EntryStackItem* entry_stack_;
int stack_trace_nesting_level_;
......@@ -1584,7 +1579,6 @@ class Isolate : private HiddenFactory {
#endif
Debug* debug_;
CpuProfiler* cpu_profiler_;
HeapProfiler* heap_profiler_;
std::unique_ptr<CodeEventDispatcher> code_event_dispatcher_;
FunctionEntryHook function_entry_hook_;
......
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