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

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

Issue 2576453002: [heap] Create a thin wrapper around wrapper tracing in V8 to avoid misuse (Closed)
Patch Set: Include Created 4 years 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/incremental-marking.cc ('k') | src/heap/objects-visiting.h » ('j') | 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 42307cd84cf5b2789e136fac80fef789f837d45b..52e1706b82ac3637625f155c558f640c08362c23 100644
--- a/src/heap/mark-compact.cc
+++ b/src/heap/mark-compact.cc
@@ -796,24 +796,17 @@ void MarkCompactCollector::Prepare() {
AbortWeakCells();
AbortTransitionArrays();
AbortCompaction();
- if (heap_->UsingEmbedderHeapTracer()) {
- heap_->embedder_heap_tracer()->AbortTracing();
- heap_->clear_wrappers_to_trace();
- }
+ heap_->local_embedder_heap_tracer()->AbortTracing();
marking_deque()->Clear();
was_marked_incrementally_ = false;
}
if (!was_marked_incrementally_) {
- if (heap_->UsingEmbedderHeapTracer()) {
- TRACE_GC(heap()->tracer(), GCTracer::Scope::MC_MARK_WRAPPER_PROLOGUE);
- heap_->embedder_heap_tracer()->TracePrologue();
- }
+ TRACE_GC(heap()->tracer(), GCTracer::Scope::MC_MARK_WRAPPER_PROLOGUE);
+ heap_->local_embedder_heap_tracer()->TracePrologue();
}
- if (heap_->UsingEmbedderHeapTracer()) {
- heap_->embedder_heap_tracer()->EnterFinalPause();
- }
+ heap_->local_embedder_heap_tracer()->EnterFinalPause();
// Don't start compaction if we are in the middle of incremental
// marking cycle. We did not collect any slots.
@@ -2141,10 +2134,9 @@ void MarkCompactCollector::ProcessEphemeralMarking(
bool work_to_do = true;
while (work_to_do) {
if (!only_process_harmony_weak_collections) {
- if (heap_->UsingEmbedderHeapTracer()) {
+ if (heap_->local_embedder_heap_tracer()->InUse()) {
TRACE_GC(heap()->tracer(), GCTracer::Scope::MC_MARK_WRAPPER_TRACING);
- heap_->RegisterWrappersWithEmbedderHeapTracer();
- heap_->embedder_heap_tracer()->AdvanceTracing(
+ heap_->local_embedder_heap_tracer()->Trace(
0,
EmbedderHeapTracer::AdvanceTracingActions(
EmbedderHeapTracer::ForceCompletionAction::FORCE_COMPLETION));
@@ -2159,7 +2151,7 @@ void MarkCompactCollector::ProcessEphemeralMarking(
// discovering new objects reachable from weak roots (that have been made
// strong). This is a limitation of not having a separate handle type
// that doesn't require zapping before this phase. See crbug.com/668060.
- heap_->clear_wrappers_to_trace();
+ heap_->local_embedder_heap_tracer()->ClearCachedWrappersToTrace();
}
ProcessWeakCollections();
work_to_do = !marking_deque()->IsEmpty();
@@ -2502,9 +2494,9 @@ void MarkCompactCollector::MarkLiveObjects() {
{
TRACE_GC(heap()->tracer(), GCTracer::Scope::MC_MARK_WEAK_CLOSURE_HARMONY);
ProcessEphemeralMarking(&root_visitor, true);
- if (heap_->UsingEmbedderHeapTracer()) {
+ {
TRACE_GC(heap()->tracer(), GCTracer::Scope::MC_MARK_WRAPPER_EPILOGUE);
- heap()->embedder_heap_tracer()->TraceEpilogue();
+ heap()->local_embedder_heap_tracer()->TraceEpilogue();
}
}
}
« no previous file with comments | « src/heap/incremental-marking.cc ('k') | src/heap/objects-visiting.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698