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/frames-inl.h" | 8 #include "src/frames-inl.h" |
9 #include "src/msan.h" | 9 #include "src/msan.h" |
10 #include "src/simulator.h" | 10 #include "src/simulator.h" |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
207 // The frame is not setup, so it'd be hard to iterate the stack. Bailout. | 207 // The frame is not setup, so it'd be hard to iterate the stack. Bailout. |
208 return false; | 208 return false; |
209 } | 209 } |
210 | 210 |
211 i::ExternalCallbackScope* scope = isolate->external_callback_scope(); | 211 i::ExternalCallbackScope* scope = isolate->external_callback_scope(); |
212 i::Address handler = i::Isolate::handler(isolate->thread_local_top()); | 212 i::Address handler = i::Isolate::handler(isolate->thread_local_top()); |
213 // If there is a handler on top of the external callback scope then | 213 // If there is a handler on top of the external callback scope then |
214 // we have already entrered JavaScript again and the external callback | 214 // we have already entrered JavaScript again and the external callback |
215 // is not the top function. | 215 // is not the top function. |
216 if (scope && scope->scope_address() < handler) { | 216 if (scope && scope->scope_address() < handler) { |
| 217 i::Address* external_callback_entry_ptr = |
| 218 scope->callback_entrypoint_address(); |
217 sample_info->external_callback_entry = | 219 sample_info->external_callback_entry = |
218 *scope->callback_entrypoint_address(); | 220 external_callback_entry_ptr == nullptr ? nullptr |
| 221 : *external_callback_entry_ptr; |
219 } | 222 } |
220 | 223 |
221 i::SafeStackFrameIterator it(isolate, reinterpret_cast<i::Address>(regs->fp), | 224 i::SafeStackFrameIterator it(isolate, reinterpret_cast<i::Address>(regs->fp), |
222 reinterpret_cast<i::Address>(regs->sp), | 225 reinterpret_cast<i::Address>(regs->sp), |
223 js_entry_sp); | 226 js_entry_sp); |
224 | 227 |
225 // If at this point iterator does not see any frames, | 228 // If at this point iterator does not see any frames, |
226 // is usually means something is wrong with the FP, | 229 // is usually means something is wrong with the FP, |
227 // e.g. it is used as a general purpose register in the function. | 230 // e.g. it is used as a general purpose register in the function. |
228 // Bailout. | 231 // Bailout. |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 bool use_simulator_reg_state) { | 263 bool use_simulator_reg_state) { |
261 v8::TickSample::Init(reinterpret_cast<v8::Isolate*>(isolate), state, | 264 v8::TickSample::Init(reinterpret_cast<v8::Isolate*>(isolate), state, |
262 record_c_entry_frame, update_stats, | 265 record_c_entry_frame, update_stats, |
263 use_simulator_reg_state); | 266 use_simulator_reg_state); |
264 if (pc == nullptr) return; | 267 if (pc == nullptr) return; |
265 timestamp = base::TimeTicks::HighResolutionNow(); | 268 timestamp = base::TimeTicks::HighResolutionNow(); |
266 } | 269 } |
267 | 270 |
268 } // namespace internal | 271 } // namespace internal |
269 } // namespace v8 | 272 } // namespace v8 |
OLD | NEW |