| 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 17 matching lines...) Expand all Loading... |
| 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 "../include/v8-profiler.h" | 33 #include "../include/v8-profiler.h" |
| 34 | 34 |
| 35 namespace v8 { | 35 namespace v8 { |
| 36 namespace internal { | 36 namespace internal { |
| 37 | 37 |
| 38 struct OffsetRange; |
| 39 |
| 38 class TokenEnumerator { | 40 class TokenEnumerator { |
| 39 public: | 41 public: |
| 40 TokenEnumerator(); | 42 TokenEnumerator(); |
| 41 ~TokenEnumerator(); | 43 ~TokenEnumerator(); |
| 42 int GetTokenId(Object* token); | 44 int GetTokenId(Object* token); |
| 43 | 45 |
| 44 static const int kNoSecurityToken = -1; | 46 static const int kNoSecurityToken = -1; |
| 45 static const int kInheritsSecurityToken = -2; | 47 static const int kInheritsSecurityToken = -2; |
| 46 | 48 |
| 47 private: | 49 private: |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 | 95 |
| 94 class CodeEntry { | 96 class CodeEntry { |
| 95 public: | 97 public: |
| 96 // CodeEntry doesn't own name strings, just references them. | 98 // CodeEntry doesn't own name strings, just references them. |
| 97 INLINE(CodeEntry(Logger::LogEventsAndTags tag, | 99 INLINE(CodeEntry(Logger::LogEventsAndTags tag, |
| 98 const char* name_prefix, | 100 const char* name_prefix, |
| 99 const char* name, | 101 const char* name, |
| 100 const char* resource_name, | 102 const char* resource_name, |
| 101 int line_number, | 103 int line_number, |
| 102 int security_token_id)); | 104 int security_token_id)); |
| 105 ~CodeEntry(); |
| 103 | 106 |
| 104 INLINE(bool is_js_function() const) { return is_js_function_tag(tag_); } | 107 INLINE(bool is_js_function() const) { return is_js_function_tag(tag_); } |
| 105 INLINE(const char* name_prefix() const) { return name_prefix_; } | 108 INLINE(const char* name_prefix() const) { return name_prefix_; } |
| 106 INLINE(bool has_name_prefix() const) { return name_prefix_[0] != '\0'; } | 109 INLINE(bool has_name_prefix() const) { return name_prefix_[0] != '\0'; } |
| 107 INLINE(const char* name() const) { return name_; } | 110 INLINE(const char* name() const) { return name_; } |
| 108 INLINE(const char* resource_name() const) { return resource_name_; } | 111 INLINE(const char* resource_name() const) { return resource_name_; } |
| 109 INLINE(int line_number() const) { return line_number_; } | 112 INLINE(int line_number() const) { return line_number_; } |
| 110 INLINE(void set_shared_id(int shared_id)) { shared_id_ = shared_id; } | 113 INLINE(void set_shared_id(int shared_id)) { shared_id_ = shared_id; } |
| 111 INLINE(int security_token_id() const) { return security_token_id_; } | 114 INLINE(int security_token_id() const) { return security_token_id_; } |
| 112 | 115 |
| 113 INLINE(static bool is_js_function_tag(Logger::LogEventsAndTags tag)); | 116 INLINE(static bool is_js_function_tag(Logger::LogEventsAndTags tag)); |
| 114 | 117 |
| 118 List<OffsetRange>* no_frame_ranges() const { return no_frame_ranges_; } |
| 119 void set_no_frame_ranges(List<OffsetRange>* ranges) { |
| 120 no_frame_ranges_ = ranges; |
| 121 } |
| 122 |
| 115 void CopyData(const CodeEntry& source); | 123 void CopyData(const CodeEntry& source); |
| 116 uint32_t GetCallUid() const; | 124 uint32_t GetCallUid() const; |
| 117 bool IsSameAs(CodeEntry* entry) const; | 125 bool IsSameAs(CodeEntry* entry) const; |
| 118 | 126 |
| 119 static const char* const kEmptyNamePrefix; | 127 static const char* const kEmptyNamePrefix; |
| 120 | 128 |
| 121 private: | 129 private: |
| 122 Logger::LogEventsAndTags tag_; | 130 Logger::LogEventsAndTags tag_; |
| 123 const char* name_prefix_; | 131 const char* name_prefix_; |
| 124 const char* name_; | 132 const char* name_; |
| 125 const char* resource_name_; | 133 const char* resource_name_; |
| 126 int line_number_; | 134 int line_number_; |
| 127 int shared_id_; | 135 int shared_id_; |
| 128 int security_token_id_; | 136 int security_token_id_; |
| 137 List<OffsetRange>* no_frame_ranges_; |
| 129 | 138 |
| 130 DISALLOW_COPY_AND_ASSIGN(CodeEntry); | 139 DISALLOW_COPY_AND_ASSIGN(CodeEntry); |
| 131 }; | 140 }; |
| 132 | 141 |
| 133 | 142 |
| 134 class ProfileTree; | 143 class ProfileTree; |
| 135 | 144 |
| 136 class ProfileNode { | 145 class ProfileNode { |
| 137 public: | 146 public: |
| 138 INLINE(ProfileNode(ProfileTree* tree, CodeEntry* entry)); | 147 INLINE(ProfileNode(ProfileTree* tree, CodeEntry* entry)); |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 244 | 253 |
| 245 DISALLOW_COPY_AND_ASSIGN(CpuProfile); | 254 DISALLOW_COPY_AND_ASSIGN(CpuProfile); |
| 246 }; | 255 }; |
| 247 | 256 |
| 248 | 257 |
| 249 class CodeMap { | 258 class CodeMap { |
| 250 public: | 259 public: |
| 251 CodeMap() : next_shared_id_(1) { } | 260 CodeMap() : next_shared_id_(1) { } |
| 252 void AddCode(Address addr, CodeEntry* entry, unsigned size); | 261 void AddCode(Address addr, CodeEntry* entry, unsigned size); |
| 253 void MoveCode(Address from, Address to); | 262 void MoveCode(Address from, Address to); |
| 254 CodeEntry* FindEntry(Address addr); | 263 CodeEntry* FindEntry(Address addr, Address* start = NULL); |
| 255 int GetSharedId(Address addr); | 264 int GetSharedId(Address addr); |
| 256 | 265 |
| 257 void Print(); | 266 void Print(); |
| 258 | 267 |
| 259 private: | 268 private: |
| 260 struct CodeEntryInfo { | 269 struct CodeEntryInfo { |
| 261 CodeEntryInfo(CodeEntry* an_entry, unsigned a_size) | 270 CodeEntryInfo(CodeEntry* an_entry, unsigned a_size) |
| 262 : entry(an_entry), size(a_size) { } | 271 : entry(an_entry), size(a_size) { } |
| 263 CodeEntry* entry; | 272 CodeEntry* entry; |
| 264 unsigned size; | 273 unsigned size; |
| (...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 422 CodeEntry* gc_entry_; | 431 CodeEntry* gc_entry_; |
| 423 SampleRateCalculator sample_rate_calc_; | 432 SampleRateCalculator sample_rate_calc_; |
| 424 | 433 |
| 425 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); | 434 DISALLOW_COPY_AND_ASSIGN(ProfileGenerator); |
| 426 }; | 435 }; |
| 427 | 436 |
| 428 | 437 |
| 429 } } // namespace v8::internal | 438 } } // namespace v8::internal |
| 430 | 439 |
| 431 #endif // V8_PROFILE_GENERATOR_H_ | 440 #endif // V8_PROFILE_GENERATOR_H_ |
| OLD | NEW |