Commit 3eda099c authored by hpayer's avatar hpayer Committed by Commit bot

[heap] Scalable slots buffer for parallel compaction.

BUG=chromium:524425
LOG=N

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

Cr-Commit-Position: refs/heads/master@{#30800}
parent 3d964e0b
This diff is collapsed.
......@@ -427,10 +427,13 @@ class MarkCompactCollector {
void UpdateSlotsRecordedIn(SlotsBuffer* buffer);
void MigrateObject(HeapObject* dst, HeapObject* src, int size,
AllocationSpace to_old_space);
AllocationSpace to_old_space,
SlotsBuffer** evacuation_slots_buffer);
void MigrateObjectTagged(HeapObject* dst, HeapObject* src, int size);
void MigrateObjectMixed(HeapObject* dst, HeapObject* src, int size);
void MigrateObjectTagged(HeapObject* dst, HeapObject* src, int size,
SlotsBuffer** evacuation_slots_buffer);
void MigrateObjectMixed(HeapObject* dst, HeapObject* src, int size,
SlotsBuffer** evacuation_slots_buffer);
void MigrateObjectRaw(HeapObject* dst, HeapObject* src, int size);
bool TryPromoteObject(HeapObject* object, int object_size);
......@@ -566,8 +569,6 @@ class MarkCompactCollector {
SlotsBuffer* migration_slots_buffer_;
base::Mutex migration_slots_buffer_mutex_;
// Finishes GC, performs heap verification if enabled.
void Finish();
......@@ -716,9 +717,15 @@ class MarkCompactCollector {
void EvacuateNewSpace();
bool EvacuateLiveObjectsFromPage(Page* p, PagedSpace* target_space);
bool EvacuateLiveObjectsFromPage(Page* p, PagedSpace* target_space,
SlotsBuffer** evacuation_slots_buffer);
void AddEvacuationSlotsBufferSynchronized(
SlotsBuffer* evacuation_slots_buffer);
void EvacuatePages(CompactionSpaceCollection* compaction_spaces,
SlotsBuffer** evacuation_slots_buffer);
void EvacuatePages(CompactionSpaceCollection* compaction_spaces);
void EvacuatePagesInParallel();
int NumberOfParallelCompactionTasks() {
......@@ -746,13 +753,16 @@ class MarkCompactCollector {
void ParallelSweepSpaceComplete(PagedSpace* space);
// Updates store buffer and slot buffer for a pointer in a migrating object.
void RecordMigratedSlot(Object* value, Address slot);
void RecordMigratedSlot(Object* value, Address slot,
SlotsBuffer** evacuation_slots_buffer);
// Adds the code entry slot to the slots buffer.
void RecordMigratedCodeEntrySlot(Address code_entry, Address code_entry_slot);
void RecordMigratedCodeEntrySlot(Address code_entry, Address code_entry_slot,
SlotsBuffer** evacuation_slots_buffer);
// Adds the slot of a moved code object.
void RecordMigratedCodeObjectSlot(Address code_object);
void RecordMigratedCodeObjectSlot(Address code_object,
SlotsBuffer** evacuation_slots_buffer);
#ifdef DEBUG
friend class MarkObjectVisitor;
......@@ -771,6 +781,14 @@ class MarkCompactCollector {
List<Page*> evacuation_candidates_;
// The evacuation_slots_buffers_ are used by the compaction threads.
// When a compaction task finishes, it uses
// AddEvacuationSlotsbufferSynchronized to adds its slots buffer to the
// evacuation_slots_buffers_ list using the evacuation_slots_buffers_mutex_
// lock.
base::Mutex evacuation_slots_buffers_mutex_;
List<SlotsBuffer*> evacuation_slots_buffers_;
base::SmartPointer<FreeList> free_list_old_space_;
base::SmartPointer<FreeList> free_list_code_space_;
base::SmartPointer<FreeList> free_list_map_space_;
......
......@@ -16,15 +16,6 @@ bool SlotsBuffer::IsTypedSlot(ObjectSlot slot) {
}
bool SlotsBuffer::AddToSynchronized(SlotsBufferAllocator* allocator,
SlotsBuffer** buffer_address,
base::Mutex* buffer_mutex, SlotType type,
Address addr, AdditionMode mode) {
base::LockGuard<base::Mutex> lock_guard(buffer_mutex);
return AddTo(allocator, buffer_address, type, addr, mode);
}
bool SlotsBuffer::AddTo(SlotsBufferAllocator* allocator,
SlotsBuffer** buffer_address, SlotType type,
Address addr, AdditionMode mode) {
......
......@@ -122,14 +122,6 @@ class SlotsBuffer {
return buffer != NULL && buffer->chain_length_ >= kChainLengthThreshold;
}
INLINE(static bool AddToSynchronized(SlotsBufferAllocator* allocator,
SlotsBuffer** buffer_address,
base::Mutex* buffer_mutex,
ObjectSlot slot, AdditionMode mode)) {
base::LockGuard<base::Mutex> lock_guard(buffer_mutex);
return AddTo(allocator, buffer_address, slot, mode);
}
INLINE(static bool AddTo(SlotsBufferAllocator* allocator,
SlotsBuffer** buffer_address, ObjectSlot slot,
AdditionMode mode)) {
......@@ -148,11 +140,6 @@ class SlotsBuffer {
static bool IsTypedSlot(ObjectSlot slot);
static bool AddToSynchronized(SlotsBufferAllocator* allocator,
SlotsBuffer** buffer_address,
base::Mutex* buffer_mutex, SlotType type,
Address addr, AdditionMode mode);
static bool AddTo(SlotsBufferAllocator* allocator,
SlotsBuffer** buffer_address, SlotType type, Address addr,
AdditionMode mode);
......
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