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. |
457 static List<Sampler*>* active_samplers_; | 458 static List<Sampler*>* active_samplers_; |
458 | 459 |
459 DISALLOW_IMPLICIT_CONSTRUCTORS(SamplerRegistry); | 460 DISALLOW_IMPLICIT_CONSTRUCTORS(SamplerRegistry); |
460 }; | 461 }; |
461 | 462 |
462 | 463 |
463 // Class that extracts stack trace, used for profiling. | 464 // Class that extracts stack trace, used for profiling. |
464 class StackTracer : public AllStatic { | 465 class StackTracer : public AllStatic { |
465 public: | 466 public: |
466 static void Trace(Isolate* isolate, TickSample* sample); | 467 static void Trace(Isolate* isolate, TickSample* sample); |
467 }; | 468 }; |
468 | 469 |
469 } } // namespace v8::internal | 470 } } // namespace v8::internal |
470 | 471 |
471 | 472 |
472 #endif // V8_LOG_H_ | 473 #endif // V8_LOG_H_ |
OLD | NEW |