Chromium Code Reviews| Index: src/heap.h |
| diff --git a/src/heap.h b/src/heap.h |
| index ccf212b4ed6726d5f355f135a9fa0ab7d0ccdeec..e4928d3f2d9eb50ef2ee843de015a4b99aee5429 100644 |
| --- a/src/heap.h |
| +++ b/src/heap.h |
| @@ -976,6 +976,9 @@ class Heap { |
| #endif |
| } |
| + // Number of allocations done so far. |
|
Hannes Payer (out of office)
2014/06/09 15:23:51
"runtime allocations"
Igor Sheludko
2014/06/10 08:22:54
Done.
|
| + uint32_t allocations_count() { return allocations_count_; } |
| + |
| // Print short heap statistics. |
| void PrintShortHeapStatistics(); |
| @@ -1436,6 +1439,12 @@ class Heap { |
| static void FatalProcessOutOfMemory(const char* location, |
| bool take_snapshot = false); |
| + // This event is triggered after each successful allocation made by runtime. |
| + // It could be allocation either of new object or of a target space for object |
| + // evacuation. In order to track ALL allocations one must turn off |
| + // FLAG_inline_new and FLAG_use_allocation_folding. |
| + inline void OnAllocationEvent(HeapObject* object, int size_in_bytes); |
| + |
| protected: |
| // Methods made available to tests. |
| @@ -1551,6 +1560,10 @@ class Heap { |
| // Returns the amount of external memory registered since last global gc. |
| int64_t PromotedExternalMemorySize(); |
| + uint32_t allocations_count_; // how many allocations happened |
|
Hannes Payer (out of office)
2014/06/09 15:23:51
Style guide: Each comment should start in a new li
Igor Sheludko
2014/06/10 08:22:54
Done.
|
| + uint32_t raw_allocations_hash_; // running hash over allocations performed |
| + uint32_t dump_allocations_hash_countdown_; // dump allocation hash when 0 |
| + |
| unsigned int ms_count_; // how many mark-sweep collections happened |
| unsigned int gc_count_; // how many gc happened |
| @@ -2086,6 +2099,9 @@ class Heap { |
| return &weak_object_to_code_table_; |
| } |
| + inline void UpdateAllocationsHash(uint32_t value); |
| + inline void PrintAlloctionsHash(); |
| + |
| static const int kInitialStringTableSize = 2048; |
| static const int kInitialEvalCacheSize = 64; |
| static const int kInitialNumberStringCacheSize = 256; |