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

Unified Diff: src/heap/spaces-inl.h

Issue 2565713002: [heap] Initialize the owner on each page after lospace allocation (Closed)
Patch Set: Created 4 years 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/spaces.h ('k') | test/mjsunit/regress/regress-672041.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/spaces-inl.h
diff --git a/src/heap/spaces-inl.h b/src/heap/spaces-inl.h
index 685611e8151527a150a952be9ce47d28b64c0167..3d40a5457ad0a747ac4e8253db809d149b0b3958 100644
--- a/src/heap/spaces-inl.h
+++ b/src/heap/spaces-inl.h
@@ -590,6 +590,17 @@ LargePage* LargePage::Initialize(Heap* heap, MemoryChunk* chunk,
FATAL("Code page is too large.");
}
heap->incremental_marking()->SetOldSpacePageFlags(chunk);
+
+ // Initialize the owner field for each contained page (except the first, which
+ // is initialized by MemoryChunk::Initialize).
+ for (size_t i = Page::kPageSize; i < chunk->size(); i += Page::kPageSize) {
+ Address& owner_addr =
+ Memory::Address_at(chunk->address() + i + Page::kOwnerOffset);
+ const Address new_owner_value = reinterpret_cast<Address>(
+ reinterpret_cast<intptr_t>(owner_addr) & ~kPageHeaderTagMask);
+ owner_addr = new_owner_value;
Michael Lippautz 2016/12/09 20:09:40 Please just write // Clear out kPageHeaderTag.
jgruber 2016/12/12 12:48:07 Done.
+ }
+
return static_cast<LargePage*>(chunk);
}
« no previous file with comments | « src/heap/spaces.h ('k') | test/mjsunit/regress/regress-672041.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698