Index: src/heap/heap.cc |
diff --git a/src/heap/heap.cc b/src/heap/heap.cc |
index 8802266d985654b1e4792f5cddb6fafd409e32da..2751d41dbc764741ec15fa4cdf7ae961a211cbf8 100644 |
--- a/src/heap/heap.cc |
+++ b/src/heap/heap.cc |
@@ -68,7 +68,6 @@ class IdleScavengeObserver : public AllocationObserver { |
Heap& heap_; |
}; |
- |
Heap::Heap() |
: amount_of_external_allocated_memory_(0), |
amount_of_external_allocated_memory_at_last_global_gc_(0), |
@@ -116,6 +115,7 @@ Heap::Heap() |
inline_allocation_disabled_(false), |
total_regexp_code_generated_(0), |
tracer_(nullptr), |
+ embedder_heap_tracer_(nullptr), |
high_survival_rate_period_length_(0), |
promoted_objects_size_(0), |
promotion_ratio_(0), |
@@ -1303,6 +1303,11 @@ bool Heap::PerformGarbageCollection( |
UpdateOldGenerationAllocationCounter(); |
// Perform mark-sweep with optional compaction. |
MarkCompact(); |
+ if (embedder_heap_tracer()) { |
+ embedder_heap_tracer()->ClearTracingMarks( |
+ reinterpret_cast<v8::Isolate*>(isolate())); |
+ } |
+ |
old_gen_exhausted_ = false; |
old_generation_size_configured_ = true; |
// This should be updated before PostGarbageCollectionProcessing, which |
@@ -5518,6 +5523,15 @@ void Heap::RemoveGCEpilogueCallback(v8::Isolate::GCCallback callback) { |
UNREACHABLE(); |
} |
+void Heap::SetEmbedderHeapTracer(EmbedderHeapTracer* tracer) { |
+ DCHECK(tracer != nullptr); |
+ embedder_heap_tracer_ = tracer; |
+} |
+ |
+void Heap::UnsetEmbedderHeapTracer() { |
+ DCHECK(embedder_heap_tracer_ != nullptr); |
+ embedder_heap_tracer_ = nullptr; |
+} |
// TODO(ishell): Find a better place for this. |
void Heap::AddWeakObjectToCodeDependency(Handle<HeapObject> obj, |