| OLD | NEW |
| 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 Loading... |
| 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" | |
| 34 #include "../include/v8-profiler.h" | 33 #include "../include/v8-profiler.h" |
| 35 | 34 |
| 36 namespace v8 { | 35 namespace v8 { |
| 37 namespace internal { | 36 namespace internal { |
| 38 | 37 |
| 39 struct OffsetRange; | 38 struct OffsetRange; |
| 40 | 39 |
| 41 // Provides a storage of strings allocated in C++ heap, to hold them | 40 // Provides a storage of strings allocated in C++ heap, to hold them |
| 42 // forever, even if they disappear from JS heap or external storage. | 41 // forever, even if they disappear from JS heap or external storage. |
| 43 class StringsStorage { | 42 class StringsStorage { |
| (...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 196 void AddPath(const Vector<CodeEntry*>& path); | 195 void AddPath(const Vector<CodeEntry*>& path); |
| 197 void CalculateTotalTicksAndSamplingRate(); | 196 void CalculateTotalTicksAndSamplingRate(); |
| 198 | 197 |
| 199 const char* title() const { return title_; } | 198 const char* title() const { return title_; } |
| 200 unsigned uid() const { return uid_; } | 199 unsigned uid() const { return uid_; } |
| 201 const ProfileTree* top_down() const { return &top_down_; } | 200 const ProfileTree* top_down() const { return &top_down_; } |
| 202 | 201 |
| 203 int samples_count() const { return samples_.length(); } | 202 int samples_count() const { return samples_.length(); } |
| 204 ProfileNode* sample(int index) const { return samples_.at(index); } | 203 ProfileNode* sample(int index) const { return samples_.at(index); } |
| 205 | 204 |
| 206 Time start_time() const { return start_time_; } | 205 int64_t start_time_us() const { return start_time_us_; } |
| 207 Time end_time() const { return end_time_; } | 206 int64_t end_time_us() const { return end_time_us_; } |
| 208 | 207 |
| 209 void UpdateTicksScale(); | 208 void UpdateTicksScale(); |
| 210 | 209 |
| 211 void Print(); | 210 void Print(); |
| 212 | 211 |
| 213 private: | 212 private: |
| 214 const char* title_; | 213 const char* title_; |
| 215 unsigned uid_; | 214 unsigned uid_; |
| 216 bool record_samples_; | 215 bool record_samples_; |
| 217 Time start_time_; | 216 int64_t start_time_us_; |
| 218 Time end_time_; | 217 int64_t end_time_us_; |
| 219 ElapsedTimer timer_; | |
| 220 List<ProfileNode*> samples_; | 218 List<ProfileNode*> samples_; |
| 221 ProfileTree top_down_; | 219 ProfileTree top_down_; |
| 222 | 220 |
| 223 DISALLOW_COPY_AND_ASSIGN(CpuProfile); | 221 DISALLOW_COPY_AND_ASSIGN(CpuProfile); |
| 224 }; | 222 }; |
| 225 | 223 |
| 226 | 224 |
| 227 class CodeMap { | 225 class CodeMap { |
| 228 public: | 226 public: |
| 229 CodeMap() : next_shared_id_(1) { } | 227 CodeMap() : next_shared_id_(1) { } |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 345 CodeEntry* gc_entry_; | 343 CodeEntry* gc_entry_; |
| 346 CodeEntry* unresolved_entry_; | 344 CodeEntry* unresolved_entry_; |
| 347 | 345 |
| 348 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); | 346 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); |
| 349 }; | 347 }; |
| 350 | 348 |
| 351 | 349 |
| 352 } } // namespace v8::internal | 350 } } // namespace v8::internal |
| 353 | 351 |
| 354 #endif // V8_PROFILE_GENERATOR_H_ | 352 #endif // V8_PROFILE_GENERATOR_H_ |
| OLD | NEW |