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

Side by Side Diff: src/cpu-profiler.cc

Issue 8274031: Merge r9430, r9433 and r9508 into 3.5 branch. (Closed) Base URL: http://v8.googlecode.com/svn/branches/3.5/
Patch Set: '' Created 9 years, 2 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/api.cc ('k') | src/func-name-inferrer.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2010 the V8 project authors. All rights reserved. 1 // Copyright 2010 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after
555 555
556 556
557 void CpuProfiler::StopProcessor() { 557 void CpuProfiler::StopProcessor() {
558 Logger* logger = Isolate::Current()->logger(); 558 Logger* logger = Isolate::Current()->logger();
559 Sampler* sampler = reinterpret_cast<Sampler*>(logger->ticker_); 559 Sampler* sampler = reinterpret_cast<Sampler*>(logger->ticker_);
560 sampler->DecreaseProfilingDepth(); 560 sampler->DecreaseProfilingDepth();
561 if (need_to_stop_sampler_) { 561 if (need_to_stop_sampler_) {
562 sampler->Stop(); 562 sampler->Stop();
563 need_to_stop_sampler_ = false; 563 need_to_stop_sampler_ = false;
564 } 564 }
565 NoBarrier_Store(&is_profiling_, false);
565 processor_->Stop(); 566 processor_->Stop();
566 processor_->Join(); 567 processor_->Join();
567 delete processor_; 568 delete processor_;
568 delete generator_; 569 delete generator_;
569 processor_ = NULL; 570 processor_ = NULL;
570 NoBarrier_Store(&is_profiling_, false);
571 generator_ = NULL; 571 generator_ = NULL;
572 logger->logging_nesting_ = saved_logging_nesting_; 572 logger->logging_nesting_ = saved_logging_nesting_;
573 } 573 }
574 574
575 575
576 void CpuProfiler::Setup() { 576 void CpuProfiler::Setup() {
577 Isolate* isolate = Isolate::Current(); 577 Isolate* isolate = Isolate::Current();
578 if (isolate->cpu_profiler() == NULL) { 578 if (isolate->cpu_profiler() == NULL) {
579 isolate->set_cpu_profiler(new CpuProfiler()); 579 isolate->set_cpu_profiler(new CpuProfiler());
580 } 580 }
581 } 581 }
582 582
583 583
584 void CpuProfiler::TearDown() { 584 void CpuProfiler::TearDown() {
585 Isolate* isolate = Isolate::Current(); 585 Isolate* isolate = Isolate::Current();
586 if (isolate->cpu_profiler() != NULL) { 586 if (isolate->cpu_profiler() != NULL) {
587 delete isolate->cpu_profiler(); 587 delete isolate->cpu_profiler();
588 } 588 }
589 isolate->set_cpu_profiler(NULL); 589 isolate->set_cpu_profiler(NULL);
590 } 590 }
591 591
592 } } // namespace v8::internal 592 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/api.cc ('k') | src/func-name-inferrer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698