| OLD | NEW |
| 1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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/profiler/tick-sample.h" | 5 #include "src/profiler/tick-sample.h" |
| 6 | 6 |
| 7 #include "include/v8-profiler.h" | 7 #include "include/v8-profiler.h" |
| 8 #include "src/counters.h" | 8 #include "src/counters.h" |
| 9 #include "src/frames-inl.h" | 9 #include "src/frames-inl.h" |
| 10 #include "src/msan.h" | 10 #include "src/msan.h" |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 218 i::Address* external_callback_entry_ptr = | 218 i::Address* external_callback_entry_ptr = |
| 219 scope->callback_entrypoint_address(); | 219 scope->callback_entrypoint_address(); |
| 220 sample_info->external_callback_entry = | 220 sample_info->external_callback_entry = |
| 221 external_callback_entry_ptr == nullptr ? nullptr | 221 external_callback_entry_ptr == nullptr ? nullptr |
| 222 : *external_callback_entry_ptr; | 222 : *external_callback_entry_ptr; |
| 223 } | 223 } |
| 224 | 224 |
| 225 i::SafeStackFrameIterator it(isolate, reinterpret_cast<i::Address>(regs->fp), | 225 i::SafeStackFrameIterator it(isolate, reinterpret_cast<i::Address>(regs->fp), |
| 226 reinterpret_cast<i::Address>(regs->sp), | 226 reinterpret_cast<i::Address>(regs->sp), |
| 227 js_entry_sp); | 227 js_entry_sp); |
| 228 | 228 if (it.done()) return true; |
| 229 // If at this point iterator does not see any frames, | |
| 230 // is usually means something is wrong with the FP, | |
| 231 // e.g. it is used as a general purpose register in the function. | |
| 232 // Bailout. | |
| 233 if (it.done()) return false; | |
| 234 | 229 |
| 235 size_t i = 0; | 230 size_t i = 0; |
| 236 if (record_c_entry_frame == kIncludeCEntryFrame && | 231 if (record_c_entry_frame == kIncludeCEntryFrame && |
| 237 (it.top_frame_type() == internal::StackFrame::EXIT || | 232 (it.top_frame_type() == internal::StackFrame::EXIT || |
| 238 it.top_frame_type() == internal::StackFrame::BUILTIN_EXIT)) { | 233 it.top_frame_type() == internal::StackFrame::BUILTIN_EXIT)) { |
| 239 frames[i++] = isolate->c_function(); | 234 frames[i++] = isolate->c_function(); |
| 240 } | 235 } |
| 241 i::RuntimeCallTimer* timer = | 236 i::RuntimeCallTimer* timer = |
| 242 isolate->counters()->runtime_call_stats()->current_timer(); | 237 isolate->counters()->runtime_call_stats()->current_timer(); |
| 243 for (; !it.done() && i < frames_limit; it.Advance()) { | 238 for (; !it.done() && i < frames_limit; it.Advance()) { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 272 bool use_simulator_reg_state) { | 267 bool use_simulator_reg_state) { |
| 273 v8::TickSample::Init(reinterpret_cast<v8::Isolate*>(isolate), state, | 268 v8::TickSample::Init(reinterpret_cast<v8::Isolate*>(isolate), state, |
| 274 record_c_entry_frame, update_stats, | 269 record_c_entry_frame, update_stats, |
| 275 use_simulator_reg_state); | 270 use_simulator_reg_state); |
| 276 if (pc == nullptr) return; | 271 if (pc == nullptr) return; |
| 277 timestamp = base::TimeTicks::HighResolutionNow(); | 272 timestamp = base::TimeTicks::HighResolutionNow(); |
| 278 } | 273 } |
| 279 | 274 |
| 280 } // namespace internal | 275 } // namespace internal |
| 281 } // namespace v8 | 276 } // namespace v8 |
| OLD | NEW |