| 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 637 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 648 IncSamplesTaken(); | 648 IncSamplesTaken(); |
| 649 } | 649 } |
| 650 | 650 |
| 651 // This method is called for each sampling period with the current | 651 // This method is called for each sampling period with the current |
| 652 // program counter. | 652 // program counter. |
| 653 virtual void Tick(TickSample* sample) = 0; | 653 virtual void Tick(TickSample* sample) = 0; |
| 654 | 654 |
| 655 // Start and stop sampler. | 655 // Start and stop sampler. |
| 656 void Start(); | 656 void Start(); |
| 657 void Stop(); | 657 void Stop(); |
| 658 void ResetInterval(int interval); |
| 658 | 659 |
| 659 // Is the sampler used for profiling? | 660 // Is the sampler used for profiling? |
| 660 bool IsProfiling() const { return NoBarrier_Load(&profiling_) > 0; } | 661 bool IsProfiling() const { return NoBarrier_Load(&profiling_) > 0; } |
| 661 void IncreaseProfilingDepth() { NoBarrier_AtomicIncrement(&profiling_, 1); } | 662 void IncreaseProfilingDepth() { NoBarrier_AtomicIncrement(&profiling_, 1); } |
| 662 void DecreaseProfilingDepth() { NoBarrier_AtomicIncrement(&profiling_, -1); } | 663 void DecreaseProfilingDepth() { NoBarrier_AtomicIncrement(&profiling_, -1); } |
| 663 | 664 |
| 664 // Whether the sampler is running (that is, consumes resources). | 665 // Whether the sampler is running (that is, consumes resources). |
| 665 bool IsActive() const { return NoBarrier_Load(&active_); } | 666 bool IsActive() const { return NoBarrier_Load(&active_); } |
| 666 | 667 |
| 667 Isolate* isolate() { return isolate_; } | 668 Isolate* isolate() { return isolate_; } |
| (...skipping 20 matching lines...) Expand all Loading... |
| 688 Atomic32 active_; | 689 Atomic32 active_; |
| 689 PlatformData* data_; // Platform specific data. | 690 PlatformData* data_; // Platform specific data. |
| 690 int samples_taken_; // Counts stack samples taken. | 691 int samples_taken_; // Counts stack samples taken. |
| 691 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); | 692 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); |
| 692 }; | 693 }; |
| 693 | 694 |
| 694 | 695 |
| 695 } } // namespace v8::internal | 696 } } // namespace v8::internal |
| 696 | 697 |
| 697 #endif // V8_PLATFORM_H_ | 698 #endif // V8_PLATFORM_H_ |
| OLD | NEW |