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

Unified Diff: src/heap/heap.h

Issue 1559873004: [heap] Buffer counter updates for new space evacuation. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Switch AdjustLiveBytes to checking whether we are in a HeapIterator Created 4 years, 11 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 | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.h
diff --git a/src/heap/heap.h b/src/heap/heap.h
index 0a90c8f7da5d7887375a607041c0bfcb5d8d59f1..b87a26a85981e9fa1bfec629b90095eecfef65bd 100644
--- a/src/heap/heap.h
+++ b/src/heap/heap.h
@@ -1412,13 +1412,13 @@ class Heap {
void UpdateSurvivalStatistics(int start_new_space_size);
inline void IncrementPromotedObjectsSize(int object_size) {
- DCHECK(object_size > 0);
+ DCHECK_GE(object_size, 0);
promoted_objects_size_ += object_size;
}
inline intptr_t promoted_objects_size() { return promoted_objects_size_; }
inline void IncrementSemiSpaceCopiedObjectSize(int object_size) {
- DCHECK(object_size > 0);
+ DCHECK_GE(object_size, 0);
semi_space_copied_object_size_ += object_size;
}
inline intptr_t semi_space_copied_object_size() {
@@ -1928,6 +1928,16 @@ class Heap {
void ScheduleIdleScavengeIfNeeded(int bytes_allocated);
// ===========================================================================
+ // HeapIterator helpers. =====================================================
+ // ===========================================================================
+
+ void heap_iterator_start() { heap_iterator_depth_++; }
+
+ void heap_iterator_end() { heap_iterator_depth_--; }
+
+ bool in_heap_iterator() { return heap_iterator_depth_ > 0; }
+
+ // ===========================================================================
// Allocation methods. =======================================================
// ===========================================================================
@@ -2380,6 +2390,9 @@ class Heap {
ArrayBufferTracker* array_buffer_tracker_;
+ // The depth of HeapIterator nestings.
+ int heap_iterator_depth_;
+
// Used for testing purposes.
bool force_oom_;
« no previous file with comments | « no previous file | src/heap/heap.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698