OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 the V8 project authors. All rights reserved. |
2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
4 // met: | 4 // met: |
5 // | 5 // |
6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
(...skipping 618 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
629 // Avoid collecting traces while doing GC. | 629 // Avoid collecting traces while doing GC. |
630 if (state == GC) return; | 630 if (state == GC) return; |
631 | 631 |
632 const Address js_entry_sp = | 632 const Address js_entry_sp = |
633 Isolate::js_entry_sp(isolate->thread_local_top()); | 633 Isolate::js_entry_sp(isolate->thread_local_top()); |
634 if (js_entry_sp == 0) { | 634 if (js_entry_sp == 0) { |
635 // Not executing JS now. | 635 // Not executing JS now. |
636 return; | 636 return; |
637 } | 637 } |
638 | 638 |
639 external_callback = isolate->external_callback(); | 639 const Address callback = isolate->external_callback(); |
| 640 if (callback != NULL) { |
| 641 external_callback = callback; |
| 642 has_external_callback = true; |
| 643 } else { |
| 644 // Sample potential return address value for frameless invocation of |
| 645 // stubs (we'll figure out later, if this value makes sense). |
| 646 tos = Memory::Address_at(sp); |
| 647 has_external_callback = false; |
| 648 } |
640 | 649 |
641 SafeStackTraceFrameIterator it(isolate, fp, sp, sp, js_entry_sp); | 650 SafeStackTraceFrameIterator it(isolate, fp, sp, sp, js_entry_sp); |
642 int i = 0; | 651 int i = 0; |
643 while (!it.done() && i < TickSample::kMaxFramesCount) { | 652 while (!it.done() && i < TickSample::kMaxFramesCount) { |
644 stack[i++] = it.frame()->pc(); | 653 stack[i++] = it.frame()->pc(); |
645 it.Advance(); | 654 it.Advance(); |
646 } | 655 } |
647 frames_count = i; | 656 frames_count = i; |
648 } | 657 } |
649 | 658 |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
685 SamplerThread::RemoveActiveSampler(this); | 694 SamplerThread::RemoveActiveSampler(this); |
686 SetActive(false); | 695 SetActive(false); |
687 } | 696 } |
688 | 697 |
689 void Sampler::SampleStack(TickSample* sample) { | 698 void Sampler::SampleStack(TickSample* sample) { |
690 sample->Trace(isolate_); | 699 sample->Trace(isolate_); |
691 if (++samples_taken_ < 0) samples_taken_ = 0; | 700 if (++samples_taken_ < 0) samples_taken_ = 0; |
692 } | 701 } |
693 | 702 |
694 } } // namespace v8::internal | 703 } } // namespace v8::internal |
OLD | NEW |