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

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: 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 744 matching lines...) Expand 10 before | Expand all | Expand 10 after
755 755
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 class CpuProfilerThread : public Thread {
766 public:
767 static const int kCpuProfilerThreadStackSize = 64 * KB;
768
769 explicit CpuProfilerThread(Sampler* sampler);
770
771 virtual void Run() = 0;
772
773 void DoCpuProfile();
774
775 private:
776 const int vm_tgid_;
caseq 2012/08/16 14:39:22 That's a platform specific field, it should be in
777 Sampler* sampler_;
778 };
765 779
766 } } // namespace v8::internal 780 } } // namespace v8::internal
767 781
768 #endif // V8_PLATFORM_H_ 782 #endif // V8_PLATFORM_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698