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/sampler.h" | 5 #include "src/sampler.h" |
6 | 6 |
7 #if V8_OS_POSIX && !V8_OS_CYGWIN | 7 #if V8_OS_POSIX && !V8_OS_CYGWIN |
8 | 8 |
9 #define USE_SIGNALS | 9 #define USE_SIGNALS |
10 | 10 |
(...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 has_external_callback = true; | 589 has_external_callback = true; |
590 } else { | 590 } else { |
591 // Sample potential return address value for frameless invocation of | 591 // Sample potential return address value for frameless invocation of |
592 // stubs (we'll figure out later, if this value makes sense). | 592 // stubs (we'll figure out later, if this value makes sense). |
593 tos = Memory::Address_at(regs.sp); | 593 tos = Memory::Address_at(regs.sp); |
594 has_external_callback = false; | 594 has_external_callback = false; |
595 } | 595 } |
596 | 596 |
597 SafeStackFrameIterator it(isolate, regs.fp, regs.sp, js_entry_sp); | 597 SafeStackFrameIterator it(isolate, regs.fp, regs.sp, js_entry_sp); |
598 top_frame_type = it.top_frame_type(); | 598 top_frame_type = it.top_frame_type(); |
599 int i = 0; | 599 unsigned i = 0; |
600 while (!it.done() && i < TickSample::kMaxFramesCount) { | 600 while (!it.done() && i < TickSample::kMaxFramesCount) { |
601 stack[i++] = it.frame()->pc(); | 601 stack[i++] = it.frame()->pc(); |
602 it.Advance(); | 602 it.Advance(); |
603 } | 603 } |
604 frames_count = i; | 604 frames_count = i; |
605 } | 605 } |
606 | 606 |
607 | 607 |
608 void Sampler::SetUp() { | 608 void Sampler::SetUp() { |
609 #if defined(USE_SIGNALS) | 609 #if defined(USE_SIGNALS) |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
728 #endif // USE_SIMULATOR | 728 #endif // USE_SIMULATOR |
729 SampleStack(state); | 729 SampleStack(state); |
730 } | 730 } |
731 ResumeThread(profiled_thread); | 731 ResumeThread(profiled_thread); |
732 } | 732 } |
733 | 733 |
734 #endif // USE_SIGNALS | 734 #endif // USE_SIGNALS |
735 | 735 |
736 | 736 |
737 } } // namespace v8::internal | 737 } } // namespace v8::internal |
OLD | NEW |