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; ...@@ -71,7 +71,6 @@ class BigIntObject;
class Boolean; class Boolean;
class BooleanObject; class BooleanObject;
class Context; class Context;
class CpuProfiler;
class Data; class Data;
class Date; class Date;
class External; class External;
...@@ -7527,15 +7526,7 @@ class V8_EXPORT Isolate { ...@@ -7527,15 +7526,7 @@ class V8_EXPORT Isolate {
HeapProfiler* GetHeapProfiler(); HeapProfiler* GetHeapProfiler();
/** /**
* Returns CPU profiler for this isolate. Will return NULL unless the isolate * Tells the VM whether the embedder is idle or not.
* 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.
*/ */
void SetIdle(bool is_idle); void SetIdle(bool is_idle);
......
...@@ -8064,13 +8064,6 @@ HeapProfiler* Isolate::GetHeapProfiler() { ...@@ -8064,13 +8064,6 @@ HeapProfiler* Isolate::GetHeapProfiler() {
return reinterpret_cast<HeapProfiler*>(heap_profiler); 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) { void Isolate::SetIdle(bool is_idle) {
i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this); i::Isolate* isolate = reinterpret_cast<i::Isolate*>(this);
isolate->SetIdle(is_idle); isolate->SetIdle(is_idle);
......
...@@ -44,7 +44,6 @@ ...@@ -44,7 +44,6 @@
#include "src/objects/hash-table-inl.h" #include "src/objects/hash-table-inl.h"
#include "src/objects/module-inl.h" #include "src/objects/module-inl.h"
#include "src/objects/promise-inl.h" #include "src/objects/promise-inl.h"
#include "src/profiler/cpu-profiler.h"
#include "src/profiler/tracing-cpu-profiler.h" #include "src/profiler/tracing-cpu-profiler.h"
#include "src/prototype.h" #include "src/prototype.h"
#include "src/regexp/regexp-stack.h" #include "src/regexp/regexp-stack.h"
...@@ -2522,7 +2521,6 @@ Isolate::Isolate() ...@@ -2522,7 +2521,6 @@ Isolate::Isolate()
is_tail_call_elimination_enabled_(true), is_tail_call_elimination_enabled_(true),
is_isolate_in_background_(false), is_isolate_in_background_(false),
memory_savings_mode_active_(false), memory_savings_mode_active_(false),
cpu_profiler_(nullptr),
heap_profiler_(nullptr), heap_profiler_(nullptr),
code_event_dispatcher_(new CodeEventDispatcher()), code_event_dispatcher_(new CodeEventDispatcher()),
function_entry_hook_(nullptr), function_entry_hook_(nullptr),
...@@ -2643,10 +2641,6 @@ void Isolate::Deinit() { ...@@ -2643,10 +2641,6 @@ void Isolate::Deinit() {
PrintF(stdout, "=== Stress deopt counter: %u\n", stress_deopt_count_); 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. // We must stop the logger before we tear down other components.
sampler::Sampler* sampler = logger_->sampler(); sampler::Sampler* sampler = logger_->sampler();
if (sampler && sampler->IsActive()) sampler->Stop(); if (sampler && sampler->IsActive()) sampler->Stop();
...@@ -2698,9 +2692,6 @@ void Isolate::Deinit() { ...@@ -2698,9 +2692,6 @@ void Isolate::Deinit() {
delete ast_string_constants_; delete ast_string_constants_;
ast_string_constants_ = nullptr; ast_string_constants_ = nullptr;
delete cpu_profiler_;
cpu_profiler_ = nullptr;
code_event_dispatcher_.reset(); code_event_dispatcher_.reset();
delete root_index_map_; delete root_index_map_;
...@@ -4065,13 +4056,6 @@ void Isolate::SetIdle(bool is_idle) { ...@@ -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 { bool StackLimitCheck::JsHasOverflowed(uintptr_t gap) const {
StackGuard* stack_guard = isolate_->stack_guard(); StackGuard* stack_guard = isolate_->stack_guard();
#ifdef USE_SIMULATOR #ifdef USE_SIMULATOR
......
...@@ -68,7 +68,6 @@ class CompilerDispatcher; ...@@ -68,7 +68,6 @@ class CompilerDispatcher;
class ContextSlotCache; class ContextSlotCache;
class Counters; class Counters;
class CpuFeatures; class CpuFeatures;
class CpuProfiler;
class Debug; class Debug;
class DeoptimizerData; class DeoptimizerData;
class DescriptorLookupCache; class DescriptorLookupCache;
...@@ -1497,10 +1496,6 @@ class Isolate : private HiddenFactory { ...@@ -1497,10 +1496,6 @@ class Isolate : private HiddenFactory {
return ""; return "";
} }
// TODO(alph): Remove along with the deprecated GetCpuProfiler().
friend v8::CpuProfiler* v8::Isolate::GetCpuProfiler();
CpuProfiler* EnsureCpuProfiler();
base::Atomic32 id_; base::Atomic32 id_;
EntryStackItem* entry_stack_; EntryStackItem* entry_stack_;
int stack_trace_nesting_level_; int stack_trace_nesting_level_;
...@@ -1584,7 +1579,6 @@ class Isolate : private HiddenFactory { ...@@ -1584,7 +1579,6 @@ class Isolate : private HiddenFactory {
#endif #endif
Debug* debug_; Debug* debug_;
CpuProfiler* cpu_profiler_;
HeapProfiler* heap_profiler_; HeapProfiler* heap_profiler_;
std::unique_ptr<CodeEventDispatcher> code_event_dispatcher_; std::unique_ptr<CodeEventDispatcher> code_event_dispatcher_;
FunctionEntryHook function_entry_hook_; 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