| OLD | NEW |
| 1 // Copyright 2009 the V8 project authors. All rights reserved. | 1 // Copyright 2009 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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 *sample = buffer_[tail_]; | 102 *sample = buffer_[tail_]; |
| 103 bool result = overflow_; | 103 bool result = overflow_; |
| 104 tail_ = Succ(tail_); | 104 tail_ = Succ(tail_); |
| 105 overflow_ = false; | 105 overflow_ = false; |
| 106 return result; | 106 return result; |
| 107 } | 107 } |
| 108 | 108 |
| 109 void Run(); | 109 void Run(); |
| 110 | 110 |
| 111 // Pause and Resume TickSample data collection. | 111 // Pause and Resume TickSample data collection. |
| 112 bool paused() { return paused_; } | 112 bool paused() const { return paused_; } |
| 113 void pause() { paused_ = true; } | 113 void pause() { paused_ = true; } |
| 114 void resume() { paused_ = false; } | 114 void resume() { paused_ = false; } |
| 115 | 115 |
| 116 private: | 116 private: |
| 117 // Returns the next index in the cyclic buffer. | 117 // Returns the next index in the cyclic buffer. |
| 118 int Succ(int index) { return (index + 1) % kBufferSize; } | 118 int Succ(int index) { return (index + 1) % kBufferSize; } |
| 119 | 119 |
| 120 // Cyclic buffer for communicating profiling samples | 120 // Cyclic buffer for communicating profiling samples |
| 121 // between the signal handler and the worker thread. | 121 // between the signal handler and the worker thread. |
| 122 static const int kBufferSize = 128; | 122 static const int kBufferSize = 128; |
| (...skipping 1429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1552 } | 1552 } |
| 1553 // Otherwise, if the sliding state window computation has not been | 1553 // Otherwise, if the sliding state window computation has not been |
| 1554 // started we do it now. | 1554 // started we do it now. |
| 1555 if (sliding_state_window_ == NULL) { | 1555 if (sliding_state_window_ == NULL) { |
| 1556 sliding_state_window_ = new SlidingStateWindow(); | 1556 sliding_state_window_ = new SlidingStateWindow(); |
| 1557 } | 1557 } |
| 1558 #endif | 1558 #endif |
| 1559 } | 1559 } |
| 1560 | 1560 |
| 1561 } } // namespace v8::internal | 1561 } } // namespace v8::internal |
| OLD | NEW |