Commit ac1587bb authored by hlopko's avatar hlopko Committed by Commit bot

Move EmbedderHeapTracer::TracePrologue call to the beginning of full gc

With cl https://codereview.chromium.org/2043033002 blink will add new wrappers
to its marking deque (and maintain this deque) so black allocated wrappers are
not a problem anymore. To limit the scope of when blink has to detect wrappers,
we need to tell blink when we start and when we end full gcs. For that we can
nicely use TracePrologue and TraceEpilogue.

LOG=no
BUG=468240

Review-Url: https://codereview.chromium.org/2051103002
Cr-Commit-Position: refs/heads/master@{#36937}
parent deb67d7d
......@@ -5469,6 +5469,11 @@ class V8_EXPORT EmbedderHeapTracer {
*/
virtual void TraceEpilogue() = 0;
/**
* Throw away all intermediate data and reset to the initial state.
*/
virtual void AbortTracing() {}
protected:
virtual ~EmbedderHeapTracer() = default;
};
......
......@@ -542,6 +542,10 @@ void IncrementalMarking::StartMarking() {
state_ = MARKING;
if (heap_->UsingEmbedderHeapTracer()) {
heap_->mark_compact_collector()->embedder_heap_tracer()->TracePrologue();
}
RecordWriteStub::Mode mode = is_compacting_
? RecordWriteStub::INCREMENTAL_COMPACTION
: RecordWriteStub::INCREMENTAL;
......
......@@ -857,9 +857,18 @@ void MarkCompactCollector::Prepare() {
AbortWeakCells();
AbortTransitionArrays();
AbortCompaction();
if (heap_->UsingEmbedderHeapTracer()) {
heap_->mark_compact_collector()->embedder_heap_tracer()->AbortTracing();
}
was_marked_incrementally_ = false;
}
if (!was_marked_incrementally_) {
if (heap_->UsingEmbedderHeapTracer()) {
heap_->mark_compact_collector()->embedder_heap_tracer()->TracePrologue();
}
}
// Don't start compaction if we are in the middle of incremental
// marking cycle. We did not collect any slots.
if (!FLAG_never_compact && !was_marked_incrementally_) {
......@@ -2320,10 +2329,6 @@ void MarkCompactCollector::MarkLiveObjects() {
{
TRACE_GC(heap()->tracer(),
GCTracer::Scope::MC_MARK_WEAK_CLOSURE_EPHEMERAL);
if (UsingEmbedderHeapTracer()) {
embedder_heap_tracer()->TracePrologue();
ProcessMarkingDeque();
}
ProcessEphemeralMarking(&root_visitor, false);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment