OLD | NEW |
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 436 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 | 447 |
448 // Adds/Removes an active sampler. | 448 // Adds/Removes an active sampler. |
449 static void AddActiveSampler(Sampler* sampler); | 449 static void AddActiveSampler(Sampler* sampler); |
450 static void RemoveActiveSampler(Sampler* sampler); | 450 static void RemoveActiveSampler(Sampler* sampler); |
451 | 451 |
452 private: | 452 private: |
453 static bool ActiveSamplersExist() { | 453 static bool ActiveSamplersExist() { |
454 return active_samplers_ != NULL && !active_samplers_->is_empty(); | 454 return active_samplers_ != NULL && !active_samplers_->is_empty(); |
455 } | 455 } |
456 | 456 |
457 static Mutex* mutex_; // Protects the state below. | |
458 static List<Sampler*>* active_samplers_; | 457 static List<Sampler*>* active_samplers_; |
459 | 458 |
460 DISALLOW_IMPLICIT_CONSTRUCTORS(SamplerRegistry); | 459 DISALLOW_IMPLICIT_CONSTRUCTORS(SamplerRegistry); |
461 }; | 460 }; |
462 | 461 |
463 | 462 |
464 // Class that extracts stack trace, used for profiling. | 463 // Class that extracts stack trace, used for profiling. |
465 class StackTracer : public AllStatic { | 464 class StackTracer : public AllStatic { |
466 public: | 465 public: |
467 static void Trace(Isolate* isolate, TickSample* sample); | 466 static void Trace(Isolate* isolate, TickSample* sample); |
468 }; | 467 }; |
469 | 468 |
470 } } // namespace v8::internal | 469 } } // namespace v8::internal |
471 | 470 |
472 | 471 |
473 #endif // V8_LOG_H_ | 472 #endif // V8_LOG_H_ |
OLD | NEW |