Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(127)

Unified Diff: src/cpu-profiler.cc

Issue 157503002: A64: Synchronize with r18444. (Closed) Base URL: https://v8.googlecode.com/svn/branches/experimental/a64
Patch Set: Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/cpu-profiler.h ('k') | src/d8.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/cpu-profiler.cc
diff --git a/src/cpu-profiler.cc b/src/cpu-profiler.cc
index b1af621cccc1a3425e87534faafa8b14cea77c7f..c36850c1e0c436783dd5dfb5058673a59e4a7d99 100644
--- a/src/cpu-profiler.cc
+++ b/src/cpu-profiler.cc
@@ -176,6 +176,10 @@ void CpuProfiler::DeleteAllProfiles() {
void CpuProfiler::DeleteProfile(CpuProfile* profile) {
profiles_->RemoveProfile(profile);
delete profile;
+ if (profiles_->profiles()->is_empty() && !is_profiling_) {
+ // If this was the last profile, clean up all accessory data as well.
+ ResetProfiles();
+ }
}
@@ -376,7 +380,6 @@ CpuProfiler::CpuProfiler(Isolate* isolate)
sampling_interval_(TimeDelta::FromMicroseconds(
FLAG_cpu_profiler_sampling_interval)),
profiles_(new CpuProfilesCollection(isolate->heap())),
- next_profile_uid_(1),
generator_(NULL),
processor_(NULL),
is_profiling_(false) {
@@ -391,7 +394,6 @@ CpuProfiler::CpuProfiler(Isolate* isolate,
sampling_interval_(TimeDelta::FromMicroseconds(
FLAG_cpu_profiler_sampling_interval)),
profiles_(test_profiles),
- next_profile_uid_(1),
generator_(test_generator),
processor_(test_processor),
is_profiling_(false) {
@@ -417,7 +419,7 @@ void CpuProfiler::ResetProfiles() {
void CpuProfiler::StartProfiling(const char* title, bool record_samples) {
- if (profiles_->StartProfiling(title, next_profile_uid_++, record_samples)) {
+ if (profiles_->StartProfiling(title, record_samples)) {
StartProcessorIfNotStarted();
}
processor_->AddCurrentStack(isolate_);
« no previous file with comments | « src/cpu-profiler.h ('k') | src/d8.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698