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

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

Issue 2032213003: Introduce api for incremental wrapper tracing (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add comment Created 4 years, 6 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
« no previous file with comments | « src/heap/mark-compact.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/heap/mark-compact.cc
diff --git a/src/heap/mark-compact.cc b/src/heap/mark-compact.cc
index dd3be110068e5a7813aef8732681a8f1b8f6eb11..46a4d3a71e294551ae28f5844bf067a6465b522c 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -2123,8 +2123,10 @@ void MarkCompactCollector::ProcessEphemeralMarking(
bool work_to_do = true;
while (work_to_do) {
if (UsingEmbedderHeapTracer()) {
- embedder_heap_tracer()->TraceWrappersFrom(wrappers_to_trace_);
- wrappers_to_trace_.clear();
+ RegisterWrappersWithEmbedderHeapTracer();
+ embedder_heap_tracer()->AdvanceTracing(
+ 0, EmbedderHeapTracer::AdvanceTracingActions(
+ EmbedderHeapTracer::ForceCompletionAction::FORCE_COMPLETION));
}
if (!only_process_harmony_weak_collections) {
isolate()->global_handles()->IterateObjectGroups(
@@ -2241,6 +2243,15 @@ void MarkCompactCollector::SetEmbedderHeapTracer(EmbedderHeapTracer* tracer) {
embedder_heap_tracer_ = tracer;
}
+void MarkCompactCollector::RegisterWrappersWithEmbedderHeapTracer() {
+ DCHECK(UsingEmbedderHeapTracer());
+ if (wrappers_to_trace_.empty()) {
+ return;
+ }
+ embedder_heap_tracer()->RegisterV8References(wrappers_to_trace_);
+ wrappers_to_trace_.clear();
+}
+
void MarkCompactCollector::TracePossibleWrapper(JSObject* js_object) {
DCHECK(js_object->WasConstructedFromApiFunction());
if (js_object->GetInternalFieldCount() >= 2 &&
@@ -2248,7 +2259,7 @@ void MarkCompactCollector::TracePossibleWrapper(JSObject* js_object) {
js_object->GetInternalField(0) != heap_->undefined_value() &&
js_object->GetInternalField(1) != heap_->undefined_value()) {
DCHECK(reinterpret_cast<intptr_t>(js_object->GetInternalField(0)) % 2 == 0);
- wrappers_to_trace().push_back(std::pair<void*, void*>(
+ wrappers_to_trace_.push_back(std::pair<void*, void*>(
reinterpret_cast<void*>(js_object->GetInternalField(0)),
reinterpret_cast<void*>(js_object->GetInternalField(1))));
}
« no previous file with comments | « src/heap/mark-compact.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698