Index: src/heap/mark-compact.h |
diff --git a/src/heap/mark-compact.h b/src/heap/mark-compact.h |
index 20ac9f6c935873f164e2e062716757215ed68b41..cc5449f97765e7d1a6c2993b963ff569edc2df89 100644 |
--- a/src/heap/mark-compact.h |
+++ b/src/heap/mark-compact.h |
@@ -25,7 +25,9 @@ |
class MarkCompactCollector; |
class MarkingVisitor; |
class RootMarkingVisitor; |
-class LocalSlotsBuffer; |
+class SlotsBuffer; |
+class SlotsBufferAllocator; |
+ |
class Marking : public AllStatic { |
public: |
@@ -393,8 +395,8 @@ |
->IsEvacuationCandidate(); |
} |
- void RecordRelocSlot(Code* host, RelocInfo* rinfo, Object* target); |
- void RecordCodeEntrySlot(HeapObject* host, Address slot, Code* target); |
+ void RecordRelocSlot(RelocInfo* rinfo, Object* target); |
+ void RecordCodeEntrySlot(HeapObject* object, Address slot, Code* target); |
void RecordCodeTargetPatch(Address pc, Code* target); |
INLINE(void RecordSlot(HeapObject* object, Object** slot, Object* target)); |
INLINE(void ForceRecordSlot(HeapObject* object, Object** slot, |
@@ -405,8 +407,8 @@ |
void MigrateObject(HeapObject* dst, HeapObject* src, int size, |
AllocationSpace to_old_space, |
- LocalSlotsBuffer* old_to_old_slots, |
- LocalSlotsBuffer* old_to_new_slots); |
+ SlotsBuffer** evacuation_slots_buffer, |
+ LocalStoreBuffer* local_store_buffer); |
void InvalidateCode(Code* code); |
@@ -482,8 +484,9 @@ |
// whole transitive closure is known. They must be called before sweeping |
// when mark bits are still intact. |
bool IsSlotInBlackObject(Page* p, Address slot, HeapObject** out_object); |
- HeapObject* FindBlackObjectBySlotSlow(Address slot); |
+ bool IsSlotInBlackObjectSlow(Page* p, Address slot); |
bool IsSlotInLiveObject(Address slot); |
+ void VerifyIsSlotInLiveObject(Address slot, HeapObject* object); |
// Removes all the slots in the slot buffers that are within the given |
// address range. |
@@ -517,7 +520,8 @@ |
explicit MarkCompactCollector(Heap* heap); |
bool WillBeDeoptimized(Code* code); |
- void ClearInvalidRememberedSetSlots(); |
+ void EvictPopularEvacuationCandidate(Page* page); |
+ void ClearInvalidStoreAndSlotsBufferEntries(); |
void StartSweeperThreads(); |
@@ -545,6 +549,10 @@ |
bool was_marked_incrementally_; |
bool evacuation_; |
+ |
+ SlotsBufferAllocator* slots_buffer_allocator_; |
+ |
+ SlotsBuffer* migration_slots_buffer_; |
// Finishes GC, performs heap verification if enabled. |
void Finish(); |
@@ -699,6 +707,9 @@ |
void EvacuateNewSpacePrologue(); |
void EvacuateNewSpaceEpilogue(); |
+ void AddEvacuationSlotsBufferSynchronized( |
+ SlotsBuffer* evacuation_slots_buffer); |
+ |
void EvacuatePagesInParallel(); |
// The number of parallel compaction tasks, including the main thread. |
@@ -734,8 +745,16 @@ |
// Updates store buffer and slot buffer for a pointer in a migrating object. |
void RecordMigratedSlot(Object* value, Address slot, |
- LocalSlotsBuffer* old_to_old_slots, |
- LocalSlotsBuffer* old_to_new_slots); |
+ SlotsBuffer** evacuation_slots_buffer, |
+ LocalStoreBuffer* local_store_buffer); |
+ |
+ // Adds the code entry slot to the slots buffer. |
+ 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, |
+ SlotsBuffer** evacuation_slots_buffer); |
#ifdef DEBUG |
friend class MarkObjectVisitor; |
@@ -754,6 +773,14 @@ |
List<Page*> evacuation_candidates_; |
List<NewSpacePage*> newspace_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_; |