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