Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(374)

Unified Diff: src/heap.h

Issue 325553002: --verify-predictable mode added for ensuring that GC behaves deterministically. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Addressing comments Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/flag-definitions.h ('k') | src/heap.cc » ('j') | src/heap-inl.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap.h
diff --git a/src/heap.h b/src/heap.h
index ccf212b4ed6726d5f355f135a9fa0ab7d0ccdeec..7072ab1bfb9e9abec4c059ce19a56cf339b5417c 100644
--- a/src/heap.h
+++ b/src/heap.h
@@ -976,6 +976,13 @@ class Heap {
#endif
}
+ // Number of "runtime allocations" done so far.
+ uint32_t allocations_count() { return allocations_count_; }
+
+ // Returns deterministic "time" value in ms. Works only with
+ // FLAG_verify_predictable.
+ double synthetic_time() { return allocations_count_ / 100.0; }
+
// Print short heap statistics.
void PrintShortHeapStatistics();
@@ -1436,6 +1443,17 @@ class Heap {
static void FatalProcessOutOfMemory(const char* location,
bool take_snapshot = false);
+ // This event is triggered after successful allocation of a new object made
+ // by runtime. Allocations of target space for object evacuation do not
+ // trigger the event. 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);
+
+ // This event is triggered after object is moved to a new place.
+ inline void OnMoveEvent(HeapObject* target,
+ HeapObject* source,
+ int size_in_bytes);
+
protected:
// Methods made available to tests.
@@ -1551,8 +1569,20 @@ class Heap {
// Returns the amount of external memory registered since last global gc.
int64_t PromotedExternalMemorySize();
- unsigned int ms_count_; // how many mark-sweep collections happened
- unsigned int gc_count_; // how many gc happened
+ // How many "runtime allocations" happened.
+ uint32_t allocations_count_;
+
+ // Running hash over allocations performed.
+ uint32_t raw_allocations_hash_;
+
+ // Countdown counter, dumps allocation hash when 0.
+ uint32_t dump_allocations_hash_countdown_;
+
+ // How many mark-sweep collections happened.
+ unsigned int ms_count_;
+
+ // How many gc happened.
+ unsigned int gc_count_;
// For post mortem debugging.
static const int kRememberedUnmappedPages = 128;
@@ -2086,6 +2116,10 @@ class Heap {
return &weak_object_to_code_table_;
}
+ inline void UpdateAllocationsHash(HeapObject* object);
+ inline void UpdateAllocationsHash(uint32_t value);
+ inline void PrintAlloctionsHash();
+
static const int kInitialStringTableSize = 2048;
static const int kInitialEvalCacheSize = 64;
static const int kInitialNumberStringCacheSize = 256;
« no previous file with comments | « src/flag-definitions.h ('k') | src/heap.cc » ('j') | src/heap-inl.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698