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

Unified Diff: src/heap/sequential-marking-deque.h

Issue 2850373003: [heap] Fix computation of marking progress in incremental finalization. (Closed)
Patch Set: rearrange summands Created 3 years, 8 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/heap/incremental-marking.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/sequential-marking-deque.h
diff --git a/src/heap/sequential-marking-deque.h b/src/heap/sequential-marking-deque.h
index bd579ba713daad719d206db73d5eef32d81871d3..89b762f3ce435397360d324f764b85fff1c7806b 100644
--- a/src/heap/sequential-marking-deque.h
+++ b/src/heap/sequential-marking-deque.h
@@ -47,6 +47,11 @@ class SequentialMarkingDeque {
inline bool IsEmpty() { return top_ == bottom_; }
+ int Size() {
+ // Return (top - bottom + capacity) % capacity, where capacity = mask + 1.
+ return (top_ - bottom_ + mask_ + 1) & mask_;
+ }
+
bool overflowed() const { return overflowed_; }
void ClearOverflowed() { overflowed_ = false; }
@@ -114,8 +119,6 @@ class SequentialMarkingDeque {
top_ = new_top;
}
- int top() { return top_; }
-
private:
// This task uncommits the marking_deque backing store if
// markin_deque->in_use_ is false.
« no previous file with comments | « src/heap/incremental-marking.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698