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

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') | src/heap/spaces.cc » ('J')
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..dac5d73723b5c32ac5edd66f093b225ce73c9a58 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -4229,7 +4229,25 @@ 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);
+ if (i != OLD_SPACE) {
ulan 2016/04/06 16:44:43 DCHECK_NE(i, OLD_SPACE) because loop starts from C
Hannes Payer (out of office) 2016/04/06 21:23:51 Done.
+ 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') | src/heap/spaces.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698