| 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 629 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 640 profiler_ = NULL; | 640 profiler_ = NULL; |
| 641 if (IsActive()) Stop(); | 641 if (IsActive()) Stop(); |
| 642 DecreaseProfilingDepth(); | 642 DecreaseProfilingDepth(); |
| 643 sampling_thread_->Join(); | 643 sampling_thread_->Join(); |
| 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 SimulatorHelper::FillRegisters(isolate, | 650 if (!SimulatorHelper::FillRegisters(isolate, |
| 651 const_cast<v8::RegisterState*>(&state)); | 651 const_cast<v8::RegisterState*>(&state))) |
| 652 return; |
| 652 #endif | 653 #endif |
| 653 TickSample* sample = isolate->cpu_profiler()->StartTickSample(); | 654 TickSample* sample = isolate->cpu_profiler()->StartTickSample(); |
| 654 TickSample sample_obj; | 655 TickSample sample_obj; |
| 655 if (sample == NULL) sample = &sample_obj; | 656 if (sample == NULL) sample = &sample_obj; |
| 656 sample->Init(isolate, state, TickSample::kIncludeCEntryFrame, true); | 657 sample->Init(isolate, state, TickSample::kIncludeCEntryFrame, true); |
| 657 if (is_counting_samples_ && !sample->timestamp.IsNull()) { | 658 if (is_counting_samples_ && !sample->timestamp.IsNull()) { |
| 658 if (sample->state == JS) ++js_sample_count_; | 659 if (sample->state == JS) ++js_sample_count_; |
| 659 if (sample->state == EXTERNAL) ++external_sample_count_; | 660 if (sample->state == EXTERNAL) ++external_sample_count_; |
| 660 } | 661 } |
| 661 if (profiler_) profiler_->Insert(sample); | 662 if (profiler_) profiler_->Insert(sample); |
| (...skipping 1216 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1878 | 1879 |
| 1879 if (profiler_listener_.get() != nullptr) { | 1880 if (profiler_listener_.get() != nullptr) { |
| 1880 removeCodeEventListener(profiler_listener_.get()); | 1881 removeCodeEventListener(profiler_listener_.get()); |
| 1881 } | 1882 } |
| 1882 | 1883 |
| 1883 return log_->Close(); | 1884 return log_->Close(); |
| 1884 } | 1885 } |
| 1885 | 1886 |
| 1886 } // namespace internal | 1887 } // namespace internal |
| 1887 } // namespace v8 | 1888 } // namespace v8 |
| OLD | NEW |