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

Unified Diff: src/heap/heap.cc

Issue 1815153002: Introduce EmbedderHeapTracer (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Incorporated wonderful Hannes' comments Created 4 years, 9 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
« src/heap/heap.h ('K') | « src/heap/heap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/heap.cc
diff --git a/src/heap/heap.cc b/src/heap/heap.cc
index aca86484bd01b8a1dc372ac0fac8a175dd2b266c..391fcba1eefdb303f00d7d3dd0e54b9cf0780b04 100644
--- a/src/heap/heap.cc
+++ b/src/heap/heap.cc
@@ -116,6 +116,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),
@@ -5420,6 +5421,13 @@ void Heap::NotifyDeserializationComplete() {
#endif // DEBUG
}
+void Heap::RegisterExternallyReferencedObject(Object** object) {
+ DCHECK(mark_compact_collector()->in_use());
+ HeapObject* heap_object = HeapObject::cast(*object);
+ DCHECK(Contains(heap_object));
+ MarkBit mark_bit = Marking::MarkBitFrom(heap_object);
+ mark_compact_collector()->MarkObject(heap_object, mark_bit);
+}
void Heap::TearDown() {
#ifdef VERIFY_HEAP
@@ -5585,6 +5593,11 @@ void Heap::RemoveGCEpilogueCallback(v8::Isolate::GCCallback callback) {
UNREACHABLE();
}
+void Heap::SetEmbedderHeapTracer(EmbedderHeapTracer* tracer) {
+ DCHECK_NOT_NULL(tracer);
+ CHECK_NULL(embedder_heap_tracer_);
+ embedder_heap_tracer_ = tracer;
+}
// TODO(ishell): Find a better place for this.
void Heap::AddWeakObjectToCodeDependency(Handle<HeapObject> obj,
« src/heap/heap.h ('K') | « src/heap/heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698