| Index: src/log.cc
|
| diff --git a/src/log.cc b/src/log.cc
|
| index 3984d01213e55fe7258f1234a5a2d9d51a0701ff..12a365fea558d0c5cdbc10f63e2f213db8e58069 100644
|
| --- a/src/log.cc
|
| +++ b/src/log.cc
|
| @@ -1929,65 +1929,4 @@ FILE* Logger::TearDown() {
|
| return log_->Close();
|
| }
|
|
|
| -
|
| -// Protects the state below.
|
| -static Mutex* active_samplers_mutex = NULL;
|
| -
|
| -List<Sampler*>* SamplerRegistry::active_samplers_ = NULL;
|
| -
|
| -
|
| -void SamplerRegistry::SetUp() {
|
| - if (!active_samplers_mutex) {
|
| - active_samplers_mutex = OS::CreateMutex();
|
| - }
|
| -}
|
| -
|
| -
|
| -bool SamplerRegistry::IterateActiveSamplers(VisitSampler func, void* param) {
|
| - ScopedLock lock(active_samplers_mutex);
|
| - for (int i = 0;
|
| - ActiveSamplersExist() && i < active_samplers_->length();
|
| - ++i) {
|
| - func(active_samplers_->at(i), param);
|
| - }
|
| - return ActiveSamplersExist();
|
| -}
|
| -
|
| -
|
| -static void ComputeCpuProfiling(Sampler* sampler, void* flag_ptr) {
|
| - bool* flag = reinterpret_cast<bool*>(flag_ptr);
|
| - *flag |= sampler->IsProfiling();
|
| -}
|
| -
|
| -
|
| -SamplerRegistry::State SamplerRegistry::GetState() {
|
| - bool flag = false;
|
| - if (!IterateActiveSamplers(&ComputeCpuProfiling, &flag)) {
|
| - return HAS_NO_SAMPLERS;
|
| - }
|
| - return flag ? HAS_CPU_PROFILING_SAMPLERS : HAS_SAMPLERS;
|
| -}
|
| -
|
| -
|
| -void SamplerRegistry::AddActiveSampler(Sampler* sampler) {
|
| - ASSERT(sampler->IsActive());
|
| - ScopedLock lock(active_samplers_mutex);
|
| - if (active_samplers_ == NULL) {
|
| - active_samplers_ = new List<Sampler*>;
|
| - } else {
|
| - ASSERT(!active_samplers_->Contains(sampler));
|
| - }
|
| - active_samplers_->Add(sampler);
|
| -}
|
| -
|
| -
|
| -void SamplerRegistry::RemoveActiveSampler(Sampler* sampler) {
|
| - ASSERT(sampler->IsActive());
|
| - ScopedLock lock(active_samplers_mutex);
|
| - ASSERT(active_samplers_ != NULL);
|
| - bool removed = active_samplers_->RemoveElement(sampler);
|
| - ASSERT(removed);
|
| - USE(removed);
|
| -}
|
| -
|
| } } // namespace v8::internal
|
|
|