summaryrefslogtreecommitdiff
path: root/deps/v8/src/heap/mark-compact.h
diff options
context:
space:
mode:
Diffstat (limited to 'deps/v8/src/heap/mark-compact.h')
-rw-r--r--deps/v8/src/heap/mark-compact.h38
1 files changed, 31 insertions, 7 deletions
diff --git a/deps/v8/src/heap/mark-compact.h b/deps/v8/src/heap/mark-compact.h
index 589bebf63f..3ffeeed7b1 100644
--- a/deps/v8/src/heap/mark-compact.h
+++ b/deps/v8/src/heap/mark-compact.h
@@ -16,6 +16,9 @@ namespace internal {
// to the first live object in the page (only used for old and map objects).
typedef bool (*IsAliveFunction)(HeapObject* obj, int* size, int* offset);
+// Callback function to mark an object in a given heap.
+typedef void (*MarkObjectFunction)(Heap* heap, HeapObject* object);
+
// Forward declarations.
class CodeFlusher;
class MarkCompactCollector;
@@ -360,6 +363,15 @@ class SlotsBuffer {
SlotsBuffer** buffer_address, SlotType type, Address addr,
AdditionMode mode);
+ // Eliminates all stale entries from the slots buffer, i.e., slots that
+ // are not part of live objects anymore. This method must be called after
+ // marking, when the whole transitive closure is known and must be called
+ // before sweeping when mark bits are still intact.
+ static void RemoveInvalidSlots(Heap* heap, SlotsBuffer* buffer);
+
+ // Ensures that there are no invalid slots in the chain of slots buffers.
+ static void VerifySlots(Heap* heap, SlotsBuffer* buffer);
+
static const int kNumberOfElements = 1021;
private:
@@ -547,6 +559,7 @@ class MarkCompactCollector {
static const uint32_t kMultiFreeEncoding = 1;
static inline bool IsMarked(Object* obj);
+ static bool IsUnmarkedHeapObjectWithHeap(Heap* heap, Object** p);
inline Heap* heap() const { return heap_; }
inline Isolate* isolate() const;
@@ -660,6 +673,10 @@ class MarkCompactCollector {
// to artificially keep AllocationSites alive for a time.
void MarkAllocationSite(AllocationSite* site);
+ // Mark objects in implicit references groups if their parent object
+ // is marked.
+ void MarkImplicitRefGroups(MarkObjectFunction mark_object);
+
MarkingDeque* marking_deque() { return &marking_deque_; }
void EnsureMarkingDequeIsCommittedAndInitialize();
@@ -668,7 +685,13 @@ class MarkCompactCollector {
void UncommitMarkingDeque();
- void OverApproximateWeakClosure();
+ // The following four methods can just be called after marking, when the
+ // 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);
+ bool IsSlotInBlackObjectSlow(Page* p, Address slot);
+ bool IsSlotInLiveObject(Address slot);
+ void VerifyIsSlotInLiveObject(Address slot, HeapObject* object);
private:
class SweeperTask;
@@ -680,6 +703,8 @@ class MarkCompactCollector {
bool WillBeDeoptimized(Code* code);
void RemoveDeadInvalidatedCode();
void ProcessInvalidatedCode(ObjectVisitor* visitor);
+ void ClearInvalidSlotsBufferEntries(PagedSpace* space);
+ void ClearInvalidStoreAndSlotsBufferEntries();
void StartSweeperThreads();
@@ -765,10 +790,6 @@ class MarkCompactCollector {
// the string table are weak.
void MarkStringTable(RootMarkingVisitor* visitor);
- // Mark objects in implicit references groups if their parent object
- // is marked.
- void MarkImplicitRefGroups();
-
// Mark objects reachable (transitively) from objects in the marking stack
// or overflowed in the heap.
void ProcessMarkingDeque();
@@ -787,6 +808,10 @@ class MarkCompactCollector {
// otherwise a map can die and deoptimize the code.
void ProcessTopOptimizedFrame(ObjectVisitor* visitor);
+ // Retain dying maps for <FLAG_retain_maps_for_n_gc> garbage collections to
+ // increase chances of reusing of map transition tree in future.
+ void RetainMaps();
+
// Mark objects reachable (transitively) from objects in the marking
// stack. This function empties the marking stack, but may leave
// overflowed objects in the heap, in which case the marking stack's
@@ -801,14 +826,13 @@ class MarkCompactCollector {
// Callback function for telling whether the object *p is an unmarked
// heap object.
static bool IsUnmarkedHeapObject(Object** p);
- static bool IsUnmarkedHeapObjectWithHeap(Heap* heap, Object** p);
// Map transitions from a live map to a dead map must be killed.
// We replace them with a null descriptor, with the same key.
void ClearNonLiveReferences();
void ClearNonLivePrototypeTransitions(Map* map);
void ClearNonLiveMapTransitions(Map* map, MarkBit map_mark);
- void ClearMapTransitions(Map* map);
+ void ClearMapTransitions(Map* map, Map* dead_transition);
bool ClearMapBackPointer(Map* map);
void TrimDescriptorArray(Map* map, DescriptorArray* descriptors,
int number_of_own_descriptors);