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

Side by Side Diff: src/platform-openbsd.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/platform-macos.cc ('k') | src/platform-solaris.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 828 matching lines...) Expand 10 before | Expand all | Expand 10 after
839 SamplerRegistry::State state; 839 SamplerRegistry::State state;
840 while ((state = SamplerRegistry::GetState()) != 840 while ((state = SamplerRegistry::GetState()) !=
841 SamplerRegistry::HAS_NO_SAMPLERS) { 841 SamplerRegistry::HAS_NO_SAMPLERS) {
842 // When CPU profiling is enabled both JavaScript and C++ code is 842 // When CPU profiling is enabled both JavaScript and C++ code is
843 // profiled. We must not suspend. 843 // profiled. We must not suspend.
844 if (state == SamplerRegistry::HAS_CPU_PROFILING_SAMPLERS) { 844 if (state == SamplerRegistry::HAS_CPU_PROFILING_SAMPLERS) {
845 if (!signal_handler_installed_) InstallSignalHandler(); 845 if (!signal_handler_installed_) InstallSignalHandler();
846 SamplerRegistry::IterateActiveSamplers(&DoCpuProfile, this); 846 SamplerRegistry::IterateActiveSamplers(&DoCpuProfile, this);
847 } else { 847 } else {
848 if (signal_handler_installed_) RestoreSignalHandler(); 848 if (signal_handler_installed_) RestoreSignalHandler();
849 if (rate_limiter_.SuspendIfNecessary()) continue; 849 if (RuntimeProfiler::WaitForSomeIsolateToEnterJS()) continue;
850 } 850 }
851 Sleep(); // TODO(svenpanne) Figure out if OS:Sleep(interval_) is enough. 851 Sleep(); // TODO(svenpanne) Figure out if OS:Sleep(interval_) is enough.
852 } 852 }
853 } 853 }
854 854
855 static void DoCpuProfile(Sampler* sampler, void* raw_sender) { 855 static void DoCpuProfile(Sampler* sampler, void* raw_sender) {
856 if (!sampler->IsProfiling()) return; 856 if (!sampler->IsProfiling()) return;
857 SignalSender* sender = reinterpret_cast<SignalSender*>(raw_sender); 857 SignalSender* sender = reinterpret_cast<SignalSender*>(raw_sender);
858 sender->SendProfilingSignal(sampler->platform_data()->vm_tid()); 858 sender->SendProfilingSignal(sampler->platform_data()->vm_tid());
859 } 859 }
(...skipping 15 matching lines...) Expand all
875 interval, 875 interval,
876 errno); 876 errno);
877 ASSERT(result == 0 || errno == EINTR); 877 ASSERT(result == 0 || errno == EINTR);
878 } 878 }
879 #endif 879 #endif
880 USE(result); 880 USE(result);
881 } 881 }
882 882
883 const int vm_tgid_; 883 const int vm_tgid_;
884 const int interval_; 884 const int interval_;
885 RuntimeProfilerRateLimiter rate_limiter_;
886 885
887 // Protects the process wide state below. 886 // Protects the process wide state below.
888 static Mutex* mutex_; 887 static Mutex* mutex_;
889 static SignalSender* instance_; 888 static SignalSender* instance_;
890 static bool signal_handler_installed_; 889 static bool signal_handler_installed_;
891 static struct sigaction old_signal_handler_; 890 static struct sigaction old_signal_handler_;
892 891
893 private: 892 private:
894 DISALLOW_COPY_AND_ASSIGN(SignalSender); 893 DISALLOW_COPY_AND_ASSIGN(SignalSender);
895 }; 894 };
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
940 939
941 940
942 void Sampler::Stop() { 941 void Sampler::Stop() {
943 ASSERT(IsActive()); 942 ASSERT(IsActive());
944 SignalSender::RemoveActiveSampler(this); 943 SignalSender::RemoveActiveSampler(this);
945 SetActive(false); 944 SetActive(false);
946 } 945 }
947 946
948 947
949 } } // namespace v8::internal 948 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-macos.cc ('k') | src/platform-solaris.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698