Commit b7caca9f authored by jochen's avatar jochen Committed by Commit bot

When reading the map from a live object, use a barrier load

It could happen that we shrink a live object on the main thread (e.g.
MigrateFastToSlow) while we're sweeping the same page. The main
thread first creates a filler object that the release-stores the new
map. Therefore it's important to barrier load the map word of live
objects from the sweeper thread.

BUG=none
R=ulan@chromium.org,hpayer@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/797623002

Cr-Commit-Position: refs/heads/master@{#25780}
parent d0cad384
...@@ -3243,7 +3243,7 @@ static int Sweep(PagedSpace* space, FreeList* free_list, Page* p, ...@@ -3243,7 +3243,7 @@ static int Sweep(PagedSpace* space, FreeList* free_list, Page* p,
} }
HeapObject* live_object = HeapObject::FromAddress(free_end); HeapObject* live_object = HeapObject::FromAddress(free_end);
DCHECK(Marking::IsBlack(Marking::MarkBitFrom(live_object))); DCHECK(Marking::IsBlack(Marking::MarkBitFrom(live_object)));
Map* map = live_object->map(); Map* map = live_object->synchronized_map();
int size = live_object->SizeFromMap(map); int size = live_object->SizeFromMap(map);
if (sweeping_mode == SWEEP_AND_VISIT_LIVE_OBJECTS) { if (sweeping_mode == SWEEP_AND_VISIT_LIVE_OBJECTS) {
live_object->IterateBody(map->instance_type(), size, v); live_object->IterateBody(map->instance_type(), size, v);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment