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 { ...@@ -5469,6 +5469,11 @@ class V8_EXPORT EmbedderHeapTracer {
*/ */
virtual void TraceEpilogue() = 0; virtual void TraceEpilogue() = 0;
/**
* Throw away all intermediate data and reset to the initial state.
*/
virtual void AbortTracing() {}
protected: protected:
virtual ~EmbedderHeapTracer() = default; virtual ~EmbedderHeapTracer() = default;
}; };
......
...@@ -542,6 +542,10 @@ void IncrementalMarking::StartMarking() { ...@@ -542,6 +542,10 @@ void IncrementalMarking::StartMarking() {
state_ = MARKING; state_ = MARKING;
if (heap_->UsingEmbedderHeapTracer()) {
heap_->mark_compact_collector()->embedder_heap_tracer()->TracePrologue();
}
RecordWriteStub::Mode mode = is_compacting_ RecordWriteStub::Mode mode = is_compacting_
? RecordWriteStub::INCREMENTAL_COMPACTION ? RecordWriteStub::INCREMENTAL_COMPACTION
: RecordWriteStub::INCREMENTAL; : RecordWriteStub::INCREMENTAL;
......
...@@ -857,9 +857,18 @@ void MarkCompactCollector::Prepare() { ...@@ -857,9 +857,18 @@ void MarkCompactCollector::Prepare() {
AbortWeakCells(); AbortWeakCells();
AbortTransitionArrays(); AbortTransitionArrays();
AbortCompaction(); AbortCompaction();
if (heap_->UsingEmbedderHeapTracer()) {
heap_->mark_compact_collector()->embedder_heap_tracer()->AbortTracing();
}
was_marked_incrementally_ = false; 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 // Don't start compaction if we are in the middle of incremental
// marking cycle. We did not collect any slots. // marking cycle. We did not collect any slots.
if (!FLAG_never_compact && !was_marked_incrementally_) { if (!FLAG_never_compact && !was_marked_incrementally_) {
...@@ -2320,10 +2329,6 @@ void MarkCompactCollector::MarkLiveObjects() { ...@@ -2320,10 +2329,6 @@ void MarkCompactCollector::MarkLiveObjects() {
{ {
TRACE_GC(heap()->tracer(), TRACE_GC(heap()->tracer(),
GCTracer::Scope::MC_MARK_WEAK_CLOSURE_EPHEMERAL); GCTracer::Scope::MC_MARK_WEAK_CLOSURE_EPHEMERAL);
if (UsingEmbedderHeapTracer()) {
embedder_heap_tracer()->TracePrologue();
ProcessMarkingDeque();
}
ProcessEphemeralMarking(&root_visitor, false); 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