| OLD | NEW |
| 1 // Copyright 2006-2008 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2008 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 500 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 511 // program counter. | 511 // program counter. |
| 512 virtual void Tick(TickSample* sample) = 0; | 512 virtual void Tick(TickSample* sample) = 0; |
| 513 | 513 |
| 514 // Start and stop sampler. | 514 // Start and stop sampler. |
| 515 void Start(); | 515 void Start(); |
| 516 void Stop(); | 516 void Stop(); |
| 517 | 517 |
| 518 // Is the sampler used for profiling. | 518 // Is the sampler used for profiling. |
| 519 inline bool IsProfiling() { return profiling_; } | 519 inline bool IsProfiling() { return profiling_; } |
| 520 | 520 |
| 521 // Whether the sampler is running (that is, consumes resources). |
| 522 inline bool IsActive() { return active_; } |
| 523 |
| 521 class PlatformData; | 524 class PlatformData; |
| 522 protected: | |
| 523 inline bool IsActive() { return active_; } | |
| 524 | 525 |
| 525 private: | 526 private: |
| 526 int interval_; | 527 int interval_; |
| 527 bool profiling_; | 528 bool profiling_; |
| 528 bool active_; | 529 bool active_; |
| 529 PlatformData* data_; // Platform specific data. | 530 PlatformData* data_; // Platform specific data. |
| 530 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); | 531 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); |
| 531 }; | 532 }; |
| 532 | 533 |
| 533 #endif // ENABLE_LOGGING_AND_PROFILING | 534 #endif // ENABLE_LOGGING_AND_PROFILING |
| 534 | 535 |
| 535 } } // namespace v8::internal | 536 } } // namespace v8::internal |
| 536 | 537 |
| 537 #endif // V8_PLATFORM_H_ | 538 #endif // V8_PLATFORM_H_ |
| OLD | NEW |