OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 IncreaseProfilingDepth(); | 163 IncreaseProfilingDepth(); |
164 if (!FLAG_prof_lazy && !IsActive()) Start(); | 164 if (!FLAG_prof_lazy && !IsActive()) Start(); |
165 } | 165 } |
166 | 166 |
167 void ClearProfiler() { | 167 void ClearProfiler() { |
168 DecreaseProfilingDepth(); | 168 DecreaseProfilingDepth(); |
169 profiler_ = NULL; | 169 profiler_ = NULL; |
170 if (IsActive()) Stop(); | 170 if (IsActive()) Stop(); |
171 } | 171 } |
172 | 172 |
173 protected: | |
174 virtual void DoSampleStack(TickSample* sample) { | |
175 StackTracer::Trace(isolate(), sample); | |
176 } | |
177 | |
178 private: | 173 private: |
179 Profiler* profiler_; | 174 Profiler* profiler_; |
180 }; | 175 }; |
181 | 176 |
182 | 177 |
183 // | 178 // |
184 // Profiler implementation. | 179 // Profiler implementation. |
185 // | 180 // |
186 Profiler::Profiler(Isolate* isolate) | 181 Profiler::Profiler(Isolate* isolate) |
187 : Thread("v8:Profiler"), | 182 : Thread("v8:Profiler"), |
(...skipping 1801 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1989 void SamplerRegistry::RemoveActiveSampler(Sampler* sampler) { | 1984 void SamplerRegistry::RemoveActiveSampler(Sampler* sampler) { |
1990 ASSERT(sampler->IsActive()); | 1985 ASSERT(sampler->IsActive()); |
1991 ScopedLock lock(active_samplers_mutex); | 1986 ScopedLock lock(active_samplers_mutex); |
1992 ASSERT(active_samplers_ != NULL); | 1987 ASSERT(active_samplers_ != NULL); |
1993 bool removed = active_samplers_->RemoveElement(sampler); | 1988 bool removed = active_samplers_->RemoveElement(sampler); |
1994 ASSERT(removed); | 1989 ASSERT(removed); |
1995 USE(removed); | 1990 USE(removed); |
1996 } | 1991 } |
1997 | 1992 |
1998 } } // namespace v8::internal | 1993 } } // namespace v8::internal |
OLD | NEW |