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 542 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
553 // Inserts collected profiling data into buffer. | 553 // Inserts collected profiling data into buffer. |
554 void Insert(TickSample* sample) { | 554 void Insert(TickSample* sample) { |
555 if (paused_) | 555 if (paused_) |
556 return; | 556 return; |
557 | 557 |
558 if (Succ(head_) == static_cast<int>(base::NoBarrier_Load(&tail_))) { | 558 if (Succ(head_) == static_cast<int>(base::NoBarrier_Load(&tail_))) { |
559 overflow_ = true; | 559 overflow_ = true; |
560 } else { | 560 } else { |
561 buffer_[head_] = *sample; | 561 buffer_[head_] = *sample; |
562 head_ = Succ(head_); | 562 head_ = Succ(head_); |
563 buffer_semaphore_.Signal("Profiler::Insert"); // Tell we have an element. | 563 buffer_semaphore_.Signal(); // Tell we have an element. |
564 } | 564 } |
565 } | 565 } |
566 | 566 |
567 virtual void Run(); | 567 virtual void Run(); |
568 | 568 |
569 // Pause and Resume TickSample data collection. | 569 // Pause and Resume TickSample data collection. |
570 void pause() { paused_ = true; } | 570 void pause() { paused_ = true; } |
571 void resume() { paused_ = false; } | 571 void resume() { paused_ = false; } |
572 | 572 |
573 private: | 573 private: |
(...skipping 1277 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 |