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

Side by Side Diff: src/platform.h

Issue 10857035: Moving cpu profiling into its own thread. (Closed) Base URL: http://git.chromium.org/external/v8.git@master
Patch Set: added a flag to switch between old and new versions Created 8 years, 4 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
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 745 matching lines...) Expand 10 before | Expand all | Expand 10 after
756 Isolate* isolate_; 756 Isolate* isolate_;
757 const int interval_; 757 const int interval_;
758 Atomic32 profiling_; 758 Atomic32 profiling_;
759 Atomic32 active_; 759 Atomic32 active_;
760 PlatformData* data_; // Platform specific data. 760 PlatformData* data_; // Platform specific data.
761 int samples_taken_; // Counts stack samples taken. 761 int samples_taken_; // Counts stack samples taken.
762 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler); 762 DISALLOW_IMPLICIT_CONSTRUCTORS(Sampler);
763 }; 763 };
764 764
765 765
766 // ----------------------------------------------------------------------------
767 // CpuProfilerThread
768 //
769
770 class CpuProfilerThread : public Thread {
771 public:
772 static const int kCpuProfilerThreadStackSize = 64 * KB;
773
774 explicit CpuProfilerThread(Sampler* sampler);
775 virtual ~CpuProfilerThread();
776
777 virtual void Run() = 0;
778
779 void DoSample();
780
781 class PlatformData;
782 PlatformData* data() { return data_; }
783
784 PlatformData* platform_data() { return data_; }
785
786 private:
787 PlatformData* data_; // Platform specific data.
788 Sampler* sampler_;
789 };
790
791
766 } } // namespace v8::internal 792 } } // namespace v8::internal
767 793
768 #endif // V8_PLATFORM_H_ 794 #endif // V8_PLATFORM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698