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

Unified Diff: src/heap/spaces.h

Issue 2183383004: Revert of [heap] Reland "Remove black pages and use black areas instead." (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 years, 5 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/scavenger.cc ('k') | src/heap/spaces.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces.h
diff --git a/src/heap/spaces.h b/src/heap/spaces.h
index c035342bfa85058dd9be34024e17cbc6d5722be3..9d0a4f1f17d56afc89b9e8df59f2a4282312b081 100644
--- a/src/heap/spaces.h
+++ b/src/heap/spaces.h
@@ -250,6 +250,11 @@
// within the new space during evacuation.
PAGE_NEW_NEW_PROMOTION,
+ // A black page has all mark bits set to 1 (black). A black page currently
+ // cannot be iterated because it is not swept. Moreover live bytes are also
+ // not updated.
+ BLACK_PAGE,
+
// This flag is intended to be used for testing. Works only when both
// FLAG_stress_compaction and FLAG_manual_evacuation_candidates_selection
// are set. It forces the page to become an evacuation candidate at next
@@ -424,10 +429,12 @@
int LiveBytes() {
DCHECK_LE(static_cast<unsigned>(live_byte_count_), size_);
+ DCHECK(!IsFlagSet(BLACK_PAGE) || live_byte_count_ == 0);
return live_byte_count_;
}
void SetLiveBytes(int live_bytes) {
+ if (IsFlagSet(BLACK_PAGE)) return;
DCHECK_GE(live_bytes, 0);
DCHECK_LE(static_cast<size_t>(live_bytes), size_);
live_byte_count_ = live_bytes;
@@ -2068,12 +2075,14 @@
allocation_info_.Reset(top, limit);
}
- void SetAllocationInfo(Address top, Address limit);
-
// Empty space allocation info, returning unused area to free list.
- void EmptyAllocationInfo();
-
- void MarkAllocationInfoBlack();
+ void EmptyAllocationInfo() {
+ // Mark the old linear allocation area with a free space map so it can be
+ // skipped when scanning the heap.
+ int old_linear_size = static_cast<int>(limit() - top());
+ Free(top(), old_linear_size);
+ SetTopAndLimit(NULL, NULL);
+ }
void Allocate(int bytes) { accounting_stats_.AllocateBytes(bytes); }
« no previous file with comments | « src/heap/scavenger.cc ('k') | src/heap/spaces.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698