Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(38)

Side by Side Diff: src/platform-solaris.cc

Issue 11193020: Revert recent CPU profiler changes because they broke --prof. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « src/platform-openbsd.cc ('k') | src/platform-win32.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 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 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 return; 662 return;
663 } 663 }
664 if (v8::Locker::IsActive() && 664 if (v8::Locker::IsActive() &&
665 !isolate->thread_manager()->IsLockedByCurrentThread()) { 665 !isolate->thread_manager()->IsLockedByCurrentThread()) {
666 return; 666 return;
667 } 667 }
668 668
669 Sampler* sampler = isolate->logger()->sampler(); 669 Sampler* sampler = isolate->logger()->sampler();
670 if (sampler == NULL || !sampler->IsActive()) return; 670 if (sampler == NULL || !sampler->IsActive()) return;
671 671
672 TickSample* sample = CpuProfiler::StartTickSampleEvent(isolate); 672 TickSample sample_obj;
673 if (sample == NULL) return; 673 TickSample* sample = CpuProfiler::TickSampleEvent(isolate);
674 if (sample == NULL) sample = &sample_obj;
674 675
675 // Extracting the sample from the context is extremely machine dependent. 676 // Extracting the sample from the context is extremely machine dependent.
676 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context); 677 ucontext_t* ucontext = reinterpret_cast<ucontext_t*>(context);
677 mcontext_t& mcontext = ucontext->uc_mcontext; 678 mcontext_t& mcontext = ucontext->uc_mcontext;
678 sample->state = isolate->current_vm_state(); 679 sample->state = isolate->current_vm_state();
679 680
680 sample->pc = reinterpret_cast<Address>(mcontext.gregs[REG_PC]); 681 sample->pc = reinterpret_cast<Address>(mcontext.gregs[REG_PC]);
681 sample->sp = reinterpret_cast<Address>(mcontext.gregs[REG_SP]); 682 sample->sp = reinterpret_cast<Address>(mcontext.gregs[REG_SP]);
682 sample->fp = reinterpret_cast<Address>(mcontext.gregs[REG_FP]); 683 sample->fp = reinterpret_cast<Address>(mcontext.gregs[REG_FP]);
683 684
684 sampler->SampleStack(sample); 685 sampler->SampleStack(sample);
685 sampler->Tick(sample); 686 sampler->Tick(sample);
686 CpuProfiler::FinishTickSampleEvent(isolate);
687 } 687 }
688 688
689 class Sampler::PlatformData : public Malloced { 689 class Sampler::PlatformData : public Malloced {
690 public: 690 public:
691 PlatformData() : vm_tid_(GetThreadID()) {} 691 PlatformData() : vm_tid_(GetThreadID()) {}
692 692
693 pthread_t vm_tid() const { return vm_tid_; } 693 pthread_t vm_tid() const { return vm_tid_; }
694 694
695 private: 695 private:
696 pthread_t vm_tid_; 696 pthread_t vm_tid_;
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
880 data_ = new PlatformData; 880 data_ = new PlatformData;
881 } 881 }
882 882
883 883
884 Sampler::~Sampler() { 884 Sampler::~Sampler() {
885 ASSERT(!IsActive()); 885 ASSERT(!IsActive());
886 delete data_; 886 delete data_;
887 } 887 }
888 888
889 889
890 void Sampler::DoSample() {
891 // TODO(rogulenko): implement
892 }
893
894
895 void Sampler::Start() { 890 void Sampler::Start() {
896 ASSERT(!IsActive()); 891 ASSERT(!IsActive());
897 SetActive(true); 892 SetActive(true);
898 SignalSender::AddActiveSampler(this); 893 SignalSender::AddActiveSampler(this);
899 } 894 }
900 895
901 896
902 void Sampler::Stop() { 897 void Sampler::Stop() {
903 ASSERT(IsActive()); 898 ASSERT(IsActive());
904 SignalSender::RemoveActiveSampler(this); 899 SignalSender::RemoveActiveSampler(this);
905 SetActive(false); 900 SetActive(false);
906 } 901 }
907 902
908 } } // namespace v8::internal 903 } } // namespace v8::internal
OLDNEW
« no previous file with comments | « src/platform-openbsd.cc ('k') | src/platform-win32.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698