| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 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 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 231 ProfileTree top_down_; | 231 ProfileTree top_down_; |
| 232 ProfileTree bottom_up_; | 232 ProfileTree bottom_up_; |
| 233 | 233 |
| 234 DISALLOW_COPY_AND_ASSIGN(CpuProfile); | 234 DISALLOW_COPY_AND_ASSIGN(CpuProfile); |
| 235 }; | 235 }; |
| 236 | 236 |
| 237 | 237 |
| 238 class CodeMap { | 238 class CodeMap { |
| 239 public: | 239 public: |
| 240 CodeMap() : next_shared_id_(1) { } | 240 CodeMap() : next_shared_id_(1) { } |
| 241 INLINE(void AddCode(Address addr, CodeEntry* entry, unsigned size)); | 241 void AddCode(Address addr, CodeEntry* entry, unsigned size); |
| 242 INLINE(void MoveCode(Address from, Address to)); | 242 void MoveCode(Address from, Address to); |
| 243 INLINE(void DeleteCode(Address addr)); | |
| 244 CodeEntry* FindEntry(Address addr); | 243 CodeEntry* FindEntry(Address addr); |
| 245 int GetSharedId(Address addr); | 244 int GetSharedId(Address addr); |
| 246 | 245 |
| 247 void Print(); | 246 void Print(); |
| 248 | 247 |
| 249 private: | 248 private: |
| 250 struct CodeEntryInfo { | 249 struct CodeEntryInfo { |
| 251 CodeEntryInfo(CodeEntry* an_entry, unsigned a_size) | 250 CodeEntryInfo(CodeEntry* an_entry, unsigned a_size) |
| 252 : entry(an_entry), size(a_size) { } | 251 : entry(an_entry), size(a_size) { } |
| 253 CodeEntry* entry; | 252 CodeEntry* entry; |
| 254 unsigned size; | 253 unsigned size; |
| 255 }; | 254 }; |
| 256 | 255 |
| 257 struct CodeTreeConfig { | 256 struct CodeTreeConfig { |
| 258 typedef Address Key; | 257 typedef Address Key; |
| 259 typedef CodeEntryInfo Value; | 258 typedef CodeEntryInfo Value; |
| 260 static const Key kNoKey; | 259 static const Key kNoKey; |
| 261 static const Value kNoValue; | 260 static const Value kNoValue; |
| 262 static int Compare(const Key& a, const Key& b) { | 261 static int Compare(const Key& a, const Key& b) { |
| 263 return a < b ? -1 : (a > b ? 1 : 0); | 262 return a < b ? -1 : (a > b ? 1 : 0); |
| 264 } | 263 } |
| 265 }; | 264 }; |
| 266 typedef SplayTree<CodeTreeConfig> CodeTree; | 265 typedef SplayTree<CodeTreeConfig> CodeTree; |
| 267 | 266 |
| 268 class CodeTreePrinter { | 267 class CodeTreePrinter { |
| 269 public: | 268 public: |
| 270 void Call(const Address& key, const CodeEntryInfo& value); | 269 void Call(const Address& key, const CodeEntryInfo& value); |
| 271 }; | 270 }; |
| 272 | 271 |
| 272 void DeleteAllCoveredCode(Address start, Address end); |
| 273 |
| 273 // Fake CodeEntry pointer to distinguish shared function entries. | 274 // Fake CodeEntry pointer to distinguish shared function entries. |
| 274 static CodeEntry* const kSharedFunctionCodeEntry; | 275 static CodeEntry* const kSharedFunctionCodeEntry; |
| 275 | 276 |
| 276 CodeTree tree_; | 277 CodeTree tree_; |
| 277 int next_shared_id_; | 278 int next_shared_id_; |
| 278 | 279 |
| 279 DISALLOW_COPY_AND_ASSIGN(CodeMap); | 280 DISALLOW_COPY_AND_ASSIGN(CodeMap); |
| 280 }; | 281 }; |
| 281 | 282 |
| 282 | 283 |
| (...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1119 | 1120 |
| 1120 friend class HeapSnapshotJSONSerializerEnumerator; | 1121 friend class HeapSnapshotJSONSerializerEnumerator; |
| 1121 friend class HeapSnapshotJSONSerializerIterator; | 1122 friend class HeapSnapshotJSONSerializerIterator; |
| 1122 | 1123 |
| 1123 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); | 1124 DISALLOW_COPY_AND_ASSIGN(HeapSnapshotJSONSerializer); |
| 1124 }; | 1125 }; |
| 1125 | 1126 |
| 1126 } } // namespace v8::internal | 1127 } } // namespace v8::internal |
| 1127 | 1128 |
| 1128 #endif // V8_PROFILE_GENERATOR_H_ | 1129 #endif // V8_PROFILE_GENERATOR_H_ |
| OLD | NEW |