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

Unified Diff: src/heap/heap-inl.h

Issue 1415383004: Fixing --verify-predictable mode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: d8 now uses its own PredictablePlatform implementation Created 5 years, 1 month 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
Index: src/heap/heap-inl.h
diff --git a/src/heap/heap-inl.h b/src/heap/heap-inl.h
index c6185c6e30d3bcd31ae231fe192263dfae8bca5b..c7991c122a9e8243476003f66cb820b034dc09f9 100644
--- a/src/heap/heap-inl.h
+++ b/src/heap/heap-inl.h
@@ -257,20 +257,21 @@ void Heap::OnAllocationEvent(HeapObject* object, int size_in_bytes) {
profiler->AllocationEvent(object->address(), size_in_bytes);
}
- ++allocations_count_;
-
if (FLAG_verify_predictable) {
+ ++allocations_count_;
ulan 2015/11/12 11:38:15 Why the increment is conditional now?
Igor Sheludko 2015/11/12 11:53:30 We use allocations_count only for --verify-predict
+ // Advance synthetic time by making a time request.
+ MonotonicallyIncreasingTimeInMs();
+
UpdateAllocationsHash(object);
UpdateAllocationsHash(size_in_bytes);
- if ((FLAG_dump_allocations_digest_at_alloc > 0) &&
- (--dump_allocations_hash_countdown_ == 0)) {
- dump_allocations_hash_countdown_ = FLAG_dump_allocations_digest_at_alloc;
+ if (allocations_count_ % FLAG_dump_allocations_digest_at_alloc == 0) {
PrintAlloctionsHash();
}
}
if (FLAG_trace_allocation_stack_interval > 0) {
+ if (!FLAG_verify_predictable) ++allocations_count_;
if (allocations_count_ % FLAG_trace_allocation_stack_interval == 0) {
isolate()->PrintStack(stdout, Isolate::kPrintStackConcise);
}
@@ -292,14 +293,31 @@ void Heap::OnMoveEvent(HeapObject* target, HeapObject* source,
if (FLAG_verify_predictable) {
++allocations_count_;
+ // Advance synthetic time by making a time request.
+ MonotonicallyIncreasingTimeInMs();
UpdateAllocationsHash(source);
UpdateAllocationsHash(target);
UpdateAllocationsHash(size_in_bytes);
- if ((FLAG_dump_allocations_digest_at_alloc > 0) &&
- (--dump_allocations_hash_countdown_ == 0)) {
- dump_allocations_hash_countdown_ = FLAG_dump_allocations_digest_at_alloc;
+ if (allocations_count_ % FLAG_dump_allocations_digest_at_alloc == 0) {
+ PrintAlloctionsHash();
+ }
+ }
+}
+
+
+void Heap::OnFreeEvent(Address start, int size_in_bytes) {
+ if (FLAG_verify_predictable) {
+ HeapObject* object = HeapObject::FromAddress(start);
+ ++allocations_count_;
+ // Advance synthetic time by making a time request.
+ MonotonicallyIncreasingTimeInMs();
+
+ UpdateAllocationsHash(object);
+ UpdateAllocationsHash(size_in_bytes);
+
+ if (allocations_count_ % FLAG_dump_allocations_digest_at_alloc == 0) {
PrintAlloctionsHash();
}
}
« src/d8.cc ('K') | « src/heap/heap.cc ('k') | src/heap/incremental-marking.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698