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

Side by Side Diff: src/platform-cygwin.cc

Issue 11543020: Removed RuntimeProfilerRateLimiter class and RuntimeProfiler::IsSomeIsolateInJS. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years 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/isolate.h ('k') | src/platform-freebsd.cc » ('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 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 642 matching lines...) Expand 10 before | Expand all | Expand 10 after
653 // Implement Thread::Run(). 653 // Implement Thread::Run().
654 virtual void Run() { 654 virtual void Run() {
655 SamplerRegistry::State state; 655 SamplerRegistry::State state;
656 while ((state = SamplerRegistry::GetState()) != 656 while ((state = SamplerRegistry::GetState()) !=
657 SamplerRegistry::HAS_NO_SAMPLERS) { 657 SamplerRegistry::HAS_NO_SAMPLERS) {
658 // When CPU profiling is enabled both JavaScript and C++ code is 658 // When CPU profiling is enabled both JavaScript and C++ code is
659 // profiled. We must not suspend. 659 // profiled. We must not suspend.
660 if (state == SamplerRegistry::HAS_CPU_PROFILING_SAMPLERS) { 660 if (state == SamplerRegistry::HAS_CPU_PROFILING_SAMPLERS) {
661 SamplerRegistry::IterateActiveSamplers(&DoCpuProfile, this); 661 SamplerRegistry::IterateActiveSamplers(&DoCpuProfile, this);
662 } else { 662 } else {
663 if (rate_limiter_.SuspendIfNecessary()) continue; 663 if (RuntimeProfiler::WaitForSomeIsolateToEnterJS()) continue;
664 } 664 }
665 OS::Sleep(interval_); 665 OS::Sleep(interval_);
666 } 666 }
667 } 667 }
668 668
669 static void DoCpuProfile(Sampler* sampler, void* raw_sampler_thread) { 669 static void DoCpuProfile(Sampler* sampler, void* raw_sampler_thread) {
670 if (!sampler->isolate()->IsInitialized()) return; 670 if (!sampler->isolate()->IsInitialized()) return;
671 if (!sampler->IsProfiling()) return; 671 if (!sampler->IsProfiling()) return;
672 SamplerThread* sampler_thread = 672 SamplerThread* sampler_thread =
673 reinterpret_cast<SamplerThread*>(raw_sampler_thread); 673 reinterpret_cast<SamplerThread*>(raw_sampler_thread);
(...skipping 27 matching lines...) Expand all
701 sample->sp = reinterpret_cast<Address>(context.Esp); 701 sample->sp = reinterpret_cast<Address>(context.Esp);
702 sample->fp = reinterpret_cast<Address>(context.Ebp); 702 sample->fp = reinterpret_cast<Address>(context.Ebp);
703 #endif 703 #endif
704 sampler->SampleStack(sample); 704 sampler->SampleStack(sample);
705 sampler->Tick(sample); 705 sampler->Tick(sample);
706 } 706 }
707 ResumeThread(profiled_thread); 707 ResumeThread(profiled_thread);
708 } 708 }
709 709
710 const int interval_; 710 const int interval_;
711 RuntimeProfilerRateLimiter rate_limiter_;
712 711
713 // Protects the process wide state below. 712 // Protects the process wide state below.
714 static Mutex* mutex_; 713 static Mutex* mutex_;
715 static SamplerThread* instance_; 714 static SamplerThread* instance_;
716 715
717 private: 716 private:
718 DISALLOW_COPY_AND_ASSIGN(SamplerThread); 717 DISALLOW_COPY_AND_ASSIGN(SamplerThread);
719 }; 718 };
720 719
721 720
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
766 765
767 766
768 void Sampler::Stop() { 767 void Sampler::Stop() {
769 ASSERT(IsActive()); 768 ASSERT(IsActive());
770 SamplerThread::RemoveActiveSampler(this); 769 SamplerThread::RemoveActiveSampler(this);
771 SetActive(false); 770 SetActive(false);
772 } 771 }
773 772
774 773
775 } } // namespace v8::internal 774 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/isolate.h ('k') | src/platform-freebsd.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698