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

Unified Diff: src/heap/mark-compact.cc

Issue 2416563002: [heap] Fix forwarding pointer race between sweeper threads and pointer updating threads. (Closed)
Patch Set: Created 4 years, 2 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index 78bafce3d6fc52d9c871eb2286df5e6970ed74f6..4e7f0dfeec9a51b75ca8c7d8d38c18ffc5bfeca4 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -3639,7 +3639,10 @@ class PointerUpdateJobTraits {
MapWord map_word = heap_object->map_word();
// There could still be stale pointers in large object space, map space,
// and old space for pages that have been promoted.
- if (map_word.IsForwardingAddress()) {
+ // A sweeper thread may concurrently write a size value which looks like
+ // a forwarding pointer. We have to ignore these values.
+ if (map_word.IsForwardingAddress() &&
+ map_word.ToRawValue() >= Page::kPageSize) {
ulan 2016/10/12 12:18:10 I think we need to return REMOVE_SLOT if map_word.
ulan 2016/10/12 12:21:10 Nevermind, this works because InToSpace checks for
Hannes Payer (out of office) 2016/10/12 12:31:51 Yes, however I changed it to early bailout. The co
// Update the corresponding slot.
*slot = map_word.ToForwardingAddress();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698