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

Side by Side Diff: src/profile-generator.h

Issue 23295034: Add Chromium-style TimeDelta, Time and TimeTicks classes, and a new ElapsedTimer class. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Fix windows build. Created 7 years, 3 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
OLDNEW
1 // Copyright 2011 the V8 project authors. All rights reserved. 1 // Copyright 2011 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 12 matching lines...) Expand all
23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 23 // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 24 // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 27
28 #ifndef V8_PROFILE_GENERATOR_H_ 28 #ifndef V8_PROFILE_GENERATOR_H_
29 #define V8_PROFILE_GENERATOR_H_ 29 #define V8_PROFILE_GENERATOR_H_
30 30
31 #include "allocation.h" 31 #include "allocation.h"
32 #include "hashmap.h" 32 #include "hashmap.h"
33 #include "time/time.h"
33 #include "../include/v8-profiler.h" 34 #include "../include/v8-profiler.h"
34 35
35 namespace v8 { 36 namespace v8 {
36 namespace internal { 37 namespace internal {
37 38
38 struct OffsetRange; 39 struct OffsetRange;
39 40
40 // Provides a storage of strings allocated in C++ heap, to hold them 41 // Provides a storage of strings allocated in C++ heap, to hold them
41 // forever, even if they disappear from JS heap or external storage. 42 // forever, even if they disappear from JS heap or external storage.
42 class StringsStorage { 43 class StringsStorage {
(...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
209 void AddPath(const Vector<CodeEntry*>& path); 210 void AddPath(const Vector<CodeEntry*>& path);
210 void CalculateTotalTicksAndSamplingRate(); 211 void CalculateTotalTicksAndSamplingRate();
211 212
212 const char* title() const { return title_; } 213 const char* title() const { return title_; }
213 unsigned uid() const { return uid_; } 214 unsigned uid() const { return uid_; }
214 const ProfileTree* top_down() const { return &top_down_; } 215 const ProfileTree* top_down() const { return &top_down_; }
215 216
216 int samples_count() const { return samples_.length(); } 217 int samples_count() const { return samples_.length(); }
217 ProfileNode* sample(int index) const { return samples_.at(index); } 218 ProfileNode* sample(int index) const { return samples_.at(index); }
218 219
219 int64_t start_time_us() const { return start_time_us_; } 220 Time start_time() const { return start_time_; }
220 int64_t end_time_us() const { return end_time_us_; } 221 Time end_time() const { return end_time_; }
221 222
222 void UpdateTicksScale(); 223 void UpdateTicksScale();
223 224
224 void ShortPrint(); 225 void ShortPrint();
225 void Print(); 226 void Print();
226 227
227 private: 228 private:
228 const char* title_; 229 const char* title_;
229 unsigned uid_; 230 unsigned uid_;
230 bool record_samples_; 231 bool record_samples_;
231 int64_t start_time_us_; 232 Time start_time_;
232 int64_t end_time_us_; 233 Time end_time_;
234 ElapsedTimer timer_;
233 List<ProfileNode*> samples_; 235 List<ProfileNode*> samples_;
234 ProfileTree top_down_; 236 ProfileTree top_down_;
235 237
236 DISALLOW_COPY_AND_ASSIGN(CpuProfile); 238 DISALLOW_COPY_AND_ASSIGN(CpuProfile);
237 }; 239 };
238 240
239 241
240 class CodeMap { 242 class CodeMap {
241 public: 243 public:
242 CodeMap() : next_shared_id_(1) { } 244 CodeMap() : next_shared_id_(1) { }
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
358 CodeEntry* gc_entry_; 360 CodeEntry* gc_entry_;
359 CodeEntry* unresolved_entry_; 361 CodeEntry* unresolved_entry_;
360 362
361 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); 363 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator);
362 }; 364 };
363 365
364 366
365 } } // namespace v8::internal 367 } } // namespace v8::internal
366 368
367 #endif // V8_PROFILE_GENERATOR_H_ 369 #endif // V8_PROFILE_GENERATOR_H_
OLDNEW
« no previous file with comments | « src/platform-win32.cc ('k') | src/profile-generator.cc » ('j') | src/time/elapsed-timer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698