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

Unified Diff: src/cpu-profiler.cc

Issue 18336002: Test that profiler is stopped when isolate is being disposed (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Updated v8.h comments Created 7 years, 6 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 | « include/v8.h ('k') | test/cctest/test-cpu-profiler.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 109ddd5d976f0a36ccdb1512e02b2a78467238d6..51dc353f854f54044ad289f16769c7402d502673 100644
--- a/src/cpu-profiler.cc
+++ b/src/cpu-profiler.cc
@@ -425,6 +425,7 @@ CpuProfiler::CpuProfiler(Isolate* isolate)
CpuProfiler::~CpuProfiler() {
+ ASSERT(!is_profiling_);
delete token_enumerator_;
delete profiles_;
}
@@ -450,23 +451,23 @@ void CpuProfiler::StartProfiling(String* title, bool record_samples) {
void CpuProfiler::StartProcessorIfNotStarted() {
if (processor_ == NULL) {
+ Logger* logger = isolate_->logger();
// Disable logging when using the new implementation.
- saved_logging_nesting_ = isolate_->logger()->logging_nesting_;
- isolate_->logger()->logging_nesting_ = 0;
+ saved_logging_nesting_ = logger->logging_nesting_;
+ logger->logging_nesting_ = 0;
generator_ = new ProfileGenerator(profiles_);
processor_ = new ProfilerEventsProcessor(generator_, profiles_);
is_profiling_ = true;
processor_->StartSynchronously();
// Enumerate stuff we already have in the heap.
- if (isolate_->heap()->HasBeenSetUp()) {
- if (!FLAG_prof_browser_mode) {
- isolate_->logger()->LogCodeObjects();
- }
- isolate_->logger()->LogCompiledFunctions();
- isolate_->logger()->LogAccessorCallbacks();
+ ASSERT(isolate_->heap()->HasBeenSetUp());
+ if (!FLAG_prof_browser_mode) {
+ logger->LogCodeObjects();
}
+ logger->LogCompiledFunctions();
+ logger->LogAccessorCallbacks();
// Enable stack sampling.
- Sampler* sampler = isolate_->logger()->sampler();
+ Sampler* sampler = logger->sampler();
sampler->IncreaseProfilingDepth();
if (!sampler->IsActive()) {
sampler->Start();
« no previous file with comments | « include/v8.h ('k') | test/cctest/test-cpu-profiler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698