Chromium Code Reviews| 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 633 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 644 } | 644 } |
| 645 | 645 |
| 646 void SampleStack(const v8::RegisterState& state) override { | 646 void SampleStack(const v8::RegisterState& state) override { |
| 647 v8::Isolate* v8_isolate = isolate(); | 647 v8::Isolate* v8_isolate = isolate(); |
| 648 Isolate* isolate = reinterpret_cast<Isolate*>(v8_isolate); | 648 Isolate* isolate = reinterpret_cast<Isolate*>(v8_isolate); |
| 649 #if defined(USE_SIMULATOR) | 649 #if defined(USE_SIMULATOR) |
| 650 if (!SimulatorHelper::FillRegisters(isolate, | 650 if (!SimulatorHelper::FillRegisters(isolate, |
| 651 const_cast<v8::RegisterState*>(&state))) | 651 const_cast<v8::RegisterState*>(&state))) |
| 652 return; | 652 return; |
| 653 #endif | 653 #endif |
| 654 TickSample* sample = isolate->cpu_profiler()->StartTickSample(); | 654 TickSample sample; |
| 655 TickSample sample_obj; | 655 sample.Init(isolate, state, TickSample::kIncludeCEntryFrame, true); |
| 656 if (sample == NULL) sample = &sample_obj; | 656 if (is_counting_samples_ && !sample.timestamp.IsNull()) { |
|
alph
2016/06/30 01:21:01
Is it used in the profiler tests? If not, you can
lpy
2016/06/30 21:13:03
Done.
| |
| 657 sample->Init(isolate, state, TickSample::kIncludeCEntryFrame, true); | 657 if (sample.state == JS) ++js_sample_count_; |
| 658 if (is_counting_samples_ && !sample->timestamp.IsNull()) { | 658 if (sample.state == EXTERNAL) ++external_sample_count_; |
| 659 if (sample->state == JS) ++js_sample_count_; | |
| 660 if (sample->state == EXTERNAL) ++external_sample_count_; | |
| 661 } | 659 } |
| 662 if (profiler_) profiler_->Insert(sample); | 660 if (profiler_) profiler_->Insert(&sample); |
| 663 if (sample != &sample_obj) { | |
| 664 isolate->cpu_profiler()->FinishTickSample(); | |
| 665 } | |
| 666 } | 661 } |
| 667 | 662 |
| 668 private: | 663 private: |
| 669 Profiler* profiler_; | 664 Profiler* profiler_; |
| 670 SamplingThread* sampling_thread_; | 665 SamplingThread* sampling_thread_; |
| 671 }; | 666 }; |
| 672 | 667 |
| 673 | 668 |
| 674 // | 669 // |
| 675 // Profiler implementation. | 670 // Profiler implementation. |
| (...skipping 1203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1879 | 1874 |
| 1880 if (profiler_listener_.get() != nullptr) { | 1875 if (profiler_listener_.get() != nullptr) { |
| 1881 removeCodeEventListener(profiler_listener_.get()); | 1876 removeCodeEventListener(profiler_listener_.get()); |
| 1882 } | 1877 } |
| 1883 | 1878 |
| 1884 return log_->Close(); | 1879 return log_->Close(); |
| 1885 } | 1880 } |
| 1886 | 1881 |
| 1887 } // namespace internal | 1882 } // namespace internal |
| 1888 } // namespace v8 | 1883 } // namespace v8 |
| OLD | NEW |