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

Unified Diff: src/heap/heap.cc

Issue 1862063002: [heap] Don't use black pages for map, code and, lo space. Instead color objects black. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 4 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 | « no previous file | src/heap/heap-inl.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index 267f474a3af4fe8946dcf3e0974a7cd682d18217..134ea24bf487c41e6e49eb428a46b870c3a60b0c 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -4229,7 +4229,23 @@ void Heap::RegisterReservationsForBlackAllocation(Reservation* reservations) {
// TODO(hpayer): We do not have to iterate reservations on black objects
// for marking. We just have to execute the special visiting side effect
// code that adds objects to global data structures, e.g. for array buffers.
+
+ // Code space, map space, and large object space do not use black pages.
+ // Hence we have to color all objects of the reservation first black to avoid
+ // unnecessary marking deque load.
if (incremental_marking()->black_allocation()) {
+ for (int i = CODE_SPACE; i < Serializer::kNumberOfSpaces; i++) {
+ const Heap::Reservation& res = reservations[i];
+ for (auto& chunk : res) {
+ Address addr = chunk.start;
+ while (addr < chunk.end) {
+ HeapObject* obj = HeapObject::FromAddress(addr);
+ Marking::MarkBlack(Marking::MarkBitFrom(obj));
+ MemoryChunk::IncrementLiveBytesFromGC(obj, obj->Size());
+ addr += obj->Size();
+ }
+ }
+ }
for (int i = OLD_SPACE; i < Serializer::kNumberOfSpaces; i++) {
const Heap::Reservation& res = reservations[i];
for (auto& chunk : res) {
« no previous file with comments | « no previous file | src/heap/heap-inl.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698