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

Unified Diff: src/heap/mark-compact.h

Issue 890663005: Introduce a flag for tracing retaining path in GC. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 10 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 side-by-side diff with in-line comments
Download patch
Index: src/heap/mark-compact.h
diff --git a/src/heap/mark-compact.h b/src/heap/mark-compact.h
index 50c23dd810d7d17552f5dcdd9392711a640b5065..4e3352baba0b2b027a6d8fb05d3cfc5e5f395d1c 100644
--- a/src/heap/mark-compact.h
+++ b/src/heap/mark-compact.h
@@ -135,6 +135,7 @@ class Marking {
Heap* heap_;
};
+
// ----------------------------------------------------------------------------
// Marking deque for tracing live objects.
class MarkingDeque {
@@ -167,6 +168,9 @@ class MarkingDeque {
// otherwise mark the object as overflowed and wait for a rescan of the
// heap.
INLINE(void PushBlack(HeapObject* object)) {
+#ifdef TRACE_RETAINING_PATH
+ AddRetainedObject(object);
+#endif
DCHECK(object->IsHeapObject());
// TODO(jochen): Remove again before we branch for 4.2.
CHECK(object->IsHeapObject() && object->map()->IsMap());
@@ -181,6 +185,9 @@ class MarkingDeque {
}
INLINE(void PushGrey(HeapObject* object)) {
+#ifdef TRACE_RETAINING_PATH
+ AddRetainedObject(object);
+#endif
DCHECK(object->IsHeapObject());
// TODO(jochen): Remove again before we branch for 4.2.
CHECK(object->IsHeapObject() && object->map()->IsMap());
@@ -217,6 +224,10 @@ class MarkingDeque {
void set_top(int top) { top_ = top; }
private:
+#ifdef TRACE_RETAINING_PATH
+ static void AddRetainedObject(HeapObject* obj);
+#endif
+
HeapObject** array_;
// array_[(top - 1) & mask_] is the top element in the deque. The Deque is
// empty when top_ == bottom_. It is full when top_ + 1 == bottom
« src/heap/heap.cc ('K') | « src/heap/heap.cc ('k') | src/heap/mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698