| 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 "src/frames-inl.h" | 7 #include "src/frames-inl.h" |
| 8 #include "src/vm-state-inl.h" | 8 #include "src/vm-state-inl.h" |
| 9 | 9 |
| 10 | 10 |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 bool TickSample::GetStackSample(Isolate* isolate, const v8::RegisterState& regs, | 118 bool TickSample::GetStackSample(Isolate* isolate, const v8::RegisterState& regs, |
| 119 RecordCEntryFrame record_c_entry_frame, | 119 RecordCEntryFrame record_c_entry_frame, |
| 120 void** frames, size_t frames_limit, | 120 void** frames, size_t frames_limit, |
| 121 v8::SampleInfo* sample_info) { | 121 v8::SampleInfo* sample_info) { |
| 122 sample_info->frames_count = 0; | 122 sample_info->frames_count = 0; |
| 123 sample_info->vm_state = isolate->current_vm_state(); | 123 sample_info->vm_state = isolate->current_vm_state(); |
| 124 sample_info->external_callback_entry = nullptr; | 124 sample_info->external_callback_entry = nullptr; |
| 125 if (sample_info->vm_state == GC) return true; | 125 if (sample_info->vm_state == GC) return true; |
| 126 | 126 |
| 127 Address js_entry_sp = isolate->js_entry_sp(); | 127 Address js_entry_sp = isolate->js_entry_sp(); |
| 128 if (js_entry_sp == 0) return true; // Not executing JS now. | 128 if (js_entry_sp == nullptr) return true; // Not executing JS now. |
| 129 DCHECK(regs.sp); |
| 129 | 130 |
| 130 if (regs.pc && IsNoFrameRegion(static_cast<Address>(regs.pc))) { | 131 if (regs.pc && IsNoFrameRegion(static_cast<Address>(regs.pc))) { |
| 131 // Can't collect stack. | 132 // Can't collect stack. |
| 132 return false; | 133 return false; |
| 133 } | 134 } |
| 134 | 135 |
| 135 ExternalCallbackScope* scope = isolate->external_callback_scope(); | 136 ExternalCallbackScope* scope = isolate->external_callback_scope(); |
| 136 Address handler = Isolate::handler(isolate->thread_local_top()); | 137 Address handler = Isolate::handler(isolate->thread_local_top()); |
| 137 // If there is a handler on top of the external callback scope then | 138 // If there is a handler on top of the external callback scope then |
| 138 // we have already entrered JavaScript again and the external callback | 139 // we have already entrered JavaScript again and the external callback |
| (...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 217 // it is not guaranteed to be atomic even when both host and target | 218 // it is not guaranteed to be atomic even when both host and target |
| 218 // are of same bitness. | 219 // are of same bitness. |
| 219 return false; | 220 return false; |
| 220 } | 221 } |
| 221 return true; | 222 return true; |
| 222 } | 223 } |
| 223 #endif // USE_SIMULATOR | 224 #endif // USE_SIMULATOR |
| 224 | 225 |
| 225 } // namespace internal | 226 } // namespace internal |
| 226 } // namespace v8 | 227 } // namespace v8 |
| OLD | NEW |