OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/log.h" | 5 #include "src/log.h" |
6 | 6 |
7 #include <cstdarg> | 7 #include <cstdarg> |
8 #include <sstream> | 8 #include <sstream> |
9 | 9 |
10 #include "src/bailout-reason.h" | 10 #include "src/bailout-reason.h" |
(...skipping 543 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
554 // Inserts collected profiling data into buffer. | 554 // Inserts collected profiling data into buffer. |
555 void Insert(TickSample* sample) { | 555 void Insert(TickSample* sample) { |
556 if (paused_) | 556 if (paused_) |
557 return; | 557 return; |
558 | 558 |
559 if (Succ(head_) == static_cast<int>(base::NoBarrier_Load(&tail_))) { | 559 if (Succ(head_) == static_cast<int>(base::NoBarrier_Load(&tail_))) { |
560 overflow_ = true; | 560 overflow_ = true; |
561 } else { | 561 } else { |
562 buffer_[head_] = *sample; | 562 buffer_[head_] = *sample; |
563 head_ = Succ(head_); | 563 head_ = Succ(head_); |
564 buffer_semaphore_.Signal(); // Tell we have an element. | 564 buffer_semaphore_.Signal("Profiler::Insert"); // Tell we have an element. |
565 } | 565 } |
566 } | 566 } |
567 | 567 |
568 virtual void Run(); | 568 virtual void Run(); |
569 | 569 |
570 // Pause and Resume TickSample data collection. | 570 // Pause and Resume TickSample data collection. |
571 void pause() { paused_ = true; } | 571 void pause() { paused_ = true; } |
572 void resume() { paused_ = false; } | 572 void resume() { paused_ = false; } |
573 | 573 |
574 private: | 574 private: |
(...skipping 1276 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1851 removeCodeEventListener(jit_logger_); | 1851 removeCodeEventListener(jit_logger_); |
1852 delete jit_logger_; | 1852 delete jit_logger_; |
1853 jit_logger_ = NULL; | 1853 jit_logger_ = NULL; |
1854 } | 1854 } |
1855 | 1855 |
1856 return log_->Close(); | 1856 return log_->Close(); |
1857 } | 1857 } |
1858 | 1858 |
1859 } // namespace internal | 1859 } // namespace internal |
1860 } // namespace v8 | 1860 } // namespace v8 |
OLD | NEW |