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

Side by Side Diff: src/heap/mark-compact.cc

Issue 1393293002: [heap] Fix mark bits for partially compacted pages. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Fix compilation Created 5 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 unified diff | Download patch
« no previous file with comments | « no previous file | src/heap/spaces.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 the V8 project authors. All rights reserved. 1 // Copyright 2012 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "src/heap/mark-compact.h" 5 #include "src/heap/mark-compact.h"
6 6
7 #include "src/base/atomicops.h" 7 #include "src/base/atomicops.h"
8 #include "src/base/bits.h" 8 #include "src/base/bits.h"
9 #include "src/base/sys-info.h" 9 #include "src/base/sys-info.h"
10 #include "src/code-stubs.h" 10 #include "src/code-stubs.h"
(...skipping 3335 matching lines...) Expand 10 before | Expand all | Expand 10 after
3346 for (int i = 0; i < live_objects; i++) { 3346 for (int i = 0; i < live_objects; i++) {
3347 Address object_addr = cell_base + offsets[i] * kPointerSize; 3347 Address object_addr = cell_base + offsets[i] * kPointerSize;
3348 HeapObject* object = HeapObject::FromAddress(object_addr); 3348 HeapObject* object = HeapObject::FromAddress(object_addr);
3349 DCHECK(Marking::IsBlack(Marking::MarkBitFrom(object))); 3349 DCHECK(Marking::IsBlack(Marking::MarkBitFrom(object)));
3350 3350
3351 int size = object->Size(); 3351 int size = object->Size();
3352 AllocationAlignment alignment = object->RequiredAlignment(); 3352 AllocationAlignment alignment = object->RequiredAlignment();
3353 HeapObject* target_object = nullptr; 3353 HeapObject* target_object = nullptr;
3354 AllocationResult allocation = target_space->AllocateRaw(size, alignment); 3354 AllocationResult allocation = target_space->AllocateRaw(size, alignment);
3355 if (!allocation.To(&target_object)) { 3355 if (!allocation.To(&target_object)) {
3356 // We need to abort compaction for this page. Make sure that we reset
3357 // the mark bits for objects that have already been migrated.
3358 if (i > 0) {
3359 p->markbits()->ClearRange(p->AddressToMarkbitIndex(p->area_start()),
3360 p->AddressToMarkbitIndex(object_addr));
3361 }
3356 return false; 3362 return false;
3357 } 3363 }
3358 3364
3359 MigrateObject(target_object, object, size, target_space->identity(), 3365 MigrateObject(target_object, object, size, target_space->identity(),
3360 evacuation_slots_buffer); 3366 evacuation_slots_buffer);
3361 DCHECK(object->map_word().IsForwardingAddress()); 3367 DCHECK(object->map_word().IsForwardingAddress());
3362 } 3368 }
3363 3369
3364 // Clear marking bits for current cell. 3370 // Clear marking bits for current cell.
3365 *cell = 0; 3371 *cell = 0;
(...skipping 1234 matching lines...) Expand 10 before | Expand all | Expand 10 after
4600 MarkBit mark_bit = Marking::MarkBitFrom(host); 4606 MarkBit mark_bit = Marking::MarkBitFrom(host);
4601 if (Marking::IsBlack(mark_bit)) { 4607 if (Marking::IsBlack(mark_bit)) {
4602 RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, 0, host); 4608 RelocInfo rinfo(pc, RelocInfo::CODE_TARGET, 0, host);
4603 RecordRelocSlot(&rinfo, target); 4609 RecordRelocSlot(&rinfo, target);
4604 } 4610 }
4605 } 4611 }
4606 } 4612 }
4607 4613
4608 } // namespace internal 4614 } // namespace internal
4609 } // namespace v8 4615 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | src/heap/spaces.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698