| OLD | NEW |
| 1 // Copyright 2009-2010 the V8 project authors. All rights reserved. | 1 // Copyright 2009-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 52 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 63 v8::ActivityControl* control); | 63 v8::ActivityControl* control); |
| 64 static HeapSnapshot* TakeSnapshot(String* name, | 64 static HeapSnapshot* TakeSnapshot(String* name, |
| 65 int type, | 65 int type, |
| 66 v8::ActivityControl* control); | 66 v8::ActivityControl* control); |
| 67 static int GetSnapshotsCount(); | 67 static int GetSnapshotsCount(); |
| 68 static HeapSnapshot* GetSnapshot(int index); | 68 static HeapSnapshot* GetSnapshot(int index); |
| 69 static HeapSnapshot* FindSnapshot(unsigned uid); | 69 static HeapSnapshot* FindSnapshot(unsigned uid); |
| 70 | 70 |
| 71 void ObjectMoveEvent(Address from, Address to); | 71 void ObjectMoveEvent(Address from, Address to); |
| 72 | 72 |
| 73 void DefineWrapperClass( |
| 74 uint16_t class_id, v8::HeapProfiler::WrapperInfoCallback callback); |
| 75 |
| 76 v8::RetainedObjectInfo* ExecuteWrapperClassCallback(uint16_t class_id, |
| 77 Object** wrapper); |
| 73 INLINE(bool is_profiling()) { | 78 INLINE(bool is_profiling()) { |
| 74 return snapshots_->is_tracking_objects(); | 79 return snapshots_->is_tracking_objects(); |
| 75 } | 80 } |
| 76 | 81 |
| 77 // Obsolete interface. | 82 // Obsolete interface. |
| 78 // Write a single heap sample to the log file. | 83 // Write a single heap sample to the log file. |
| 79 static void WriteSample(); | 84 static void WriteSample(); |
| 80 | 85 |
| 81 private: | 86 private: |
| 82 HeapProfiler(); | 87 HeapProfiler(); |
| 83 ~HeapProfiler(); | 88 ~HeapProfiler(); |
| 84 HeapSnapshot* TakeSnapshotImpl(const char* name, | 89 HeapSnapshot* TakeSnapshotImpl(const char* name, |
| 85 int type, | 90 int type, |
| 86 v8::ActivityControl* control); | 91 v8::ActivityControl* control); |
| 87 HeapSnapshot* TakeSnapshotImpl(String* name, | 92 HeapSnapshot* TakeSnapshotImpl(String* name, |
| 88 int type, | 93 int type, |
| 89 v8::ActivityControl* control); | 94 v8::ActivityControl* control); |
| 90 | 95 |
| 91 HeapSnapshotsCollection* snapshots_; | 96 HeapSnapshotsCollection* snapshots_; |
| 92 unsigned next_snapshot_uid_; | 97 unsigned next_snapshot_uid_; |
| 98 List<v8::HeapProfiler::WrapperInfoCallback> wrapper_callbacks_; |
| 93 | 99 |
| 94 #endif // ENABLE_LOGGING_AND_PROFILING | 100 #endif // ENABLE_LOGGING_AND_PROFILING |
| 95 }; | 101 }; |
| 96 | 102 |
| 97 | 103 |
| 98 #ifdef ENABLE_LOGGING_AND_PROFILING | 104 #ifdef ENABLE_LOGGING_AND_PROFILING |
| 99 | 105 |
| 100 // JSObjectsCluster describes a group of JS objects that are | 106 // JSObjectsCluster describes a group of JS objects that are |
| 101 // considered equivalent in terms of a particular profile. | 107 // considered equivalent in terms of a particular profile. |
| 102 class JSObjectsCluster BASE_EMBEDDED { | 108 class JSObjectsCluster BASE_EMBEDDED { |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 | 341 |
| 336 private: | 342 private: |
| 337 HistogramInfo* info_; | 343 HistogramInfo* info_; |
| 338 ConstructorHeapProfile js_cons_profile_; | 344 ConstructorHeapProfile js_cons_profile_; |
| 339 RetainerHeapProfile js_retainer_profile_; | 345 RetainerHeapProfile js_retainer_profile_; |
| 340 }; | 346 }; |
| 341 | 347 |
| 342 | 348 |
| 343 class HeapEntriesMap; | 349 class HeapEntriesMap; |
| 344 class HeapEntriesAllocator; | 350 class HeapEntriesAllocator; |
| 345 class HeapSnapshot; | |
| 346 | 351 |
| 347 class AggregatedHeapSnapshotGenerator { | 352 class AggregatedHeapSnapshotGenerator { |
| 348 public: | 353 public: |
| 349 explicit AggregatedHeapSnapshotGenerator(AggregatedHeapSnapshot* snapshot); | 354 explicit AggregatedHeapSnapshotGenerator(AggregatedHeapSnapshot* snapshot); |
| 350 void GenerateSnapshot(); | 355 void GenerateSnapshot(); |
| 351 void FillHeapSnapshot(HeapSnapshot* snapshot); | 356 void FillHeapSnapshot(HeapSnapshot* snapshot); |
| 352 | 357 |
| 353 static const int kAllStringsType = LAST_TYPE + 1; | 358 static const int kAllStringsType = LAST_TYPE + 1; |
| 354 | 359 |
| 355 private: | 360 private: |
| (...skipping 24 matching lines...) Expand all Loading... |
| 380 friend class Isolate; | 385 friend class Isolate; |
| 381 | 386 |
| 382 DISALLOW_COPY_AND_ASSIGN(ProducerHeapProfile); | 387 DISALLOW_COPY_AND_ASSIGN(ProducerHeapProfile); |
| 383 }; | 388 }; |
| 384 | 389 |
| 385 #endif // ENABLE_LOGGING_AND_PROFILING | 390 #endif // ENABLE_LOGGING_AND_PROFILING |
| 386 | 391 |
| 387 } } // namespace v8::internal | 392 } } // namespace v8::internal |
| 388 | 393 |
| 389 #endif // V8_HEAP_PROFILER_H_ | 394 #endif // V8_HEAP_PROFILER_H_ |
| OLD | NEW |