Revert of [heap] Ensure progress when incrementally marking wrappers (patchset #3 id:60001 of https://codereview.chromium.org/2592403002/ )
Reason for revert:
This won't work because the finalization still checks whether both marking deques are empty, also calling into blink. So we never proceed there.
Original issue's description:
> [heap] Ensure progress when incrementally marking wrappers
>
> The problem here is estimating the marking step size for wrapper tracing. If the
> steps are too small, we cannot keep up with the mutator creating new wrappers.
> The result is an endless stream of incremental marking steps, alternating v8 and
> wrappers tracing, without ever finalizing in a GC.
>
> The mitigation here is to abort finding the fix point after 10 incremental
> iterations.
>
> A proper solution would track newly created wrappers on the blink side during
> wrapper tracing. Will give this more thought after the holidays.
>
> BUG=chromium:668164, chromium:468240
>
> Review-Url: https://codereview.chromium.org/2592403002
> Cr-Commit-Position: refs/heads/master@{#41923}
> Committed: a47417b893
TBR=ulan@chromium.org
# Skipping CQ checks because original CL landed less than 1 days ago.
NOPRESUBMIT=true
NOTREECHECKS=true
NOTRY=true
BUG=chromium:668164, chromium:468240
Review-Url: https://codereview.chromium.org/2602433002
Cr-Commit-Position: refs/heads/master@{#41924}
This commit is contained in:
parent
a47417b893
commit
73036fb691
@ -13,8 +13,6 @@ void LocalEmbedderHeapTracer::TracePrologue() {
|
||||
if (!InUse()) return;
|
||||
|
||||
CHECK(cached_wrappers_to_trace_.empty());
|
||||
num_v8_marking_deque_was_empty_ = 0;
|
||||
in_final_pause_ = false;
|
||||
remote_tracer_->TracePrologue();
|
||||
}
|
||||
|
||||
@ -35,7 +33,6 @@ void LocalEmbedderHeapTracer::AbortTracing() {
|
||||
void LocalEmbedderHeapTracer::EnterFinalPause() {
|
||||
if (!InUse()) return;
|
||||
|
||||
in_final_pause_ = true;
|
||||
remote_tracer_->EnterFinalPause();
|
||||
}
|
||||
|
||||
@ -44,10 +41,7 @@ bool LocalEmbedderHeapTracer::Trace(
|
||||
if (!InUse()) return false;
|
||||
|
||||
RegisterWrappersWithRemoteTracer();
|
||||
return (in_final_pause_ ||
|
||||
(num_v8_marking_deque_was_empty_ <= kMaxIncrementalMarkingRounds))
|
||||
? remote_tracer_->AdvanceTracing(deadline, actions)
|
||||
: false;
|
||||
return remote_tracer_->AdvanceTracing(deadline, actions);
|
||||
}
|
||||
|
||||
size_t LocalEmbedderHeapTracer::NumberOfWrappersToTrace() {
|
||||
|
@ -17,10 +17,7 @@ class V8_EXPORT_PRIVATE LocalEmbedderHeapTracer final {
|
||||
public:
|
||||
typedef std::pair<void*, void*> WrapperInfo;
|
||||
|
||||
LocalEmbedderHeapTracer()
|
||||
: remote_tracer_(nullptr),
|
||||
num_v8_marking_deque_was_empty_(0),
|
||||
in_final_pause_(false) {}
|
||||
LocalEmbedderHeapTracer() : remote_tracer_(nullptr) {}
|
||||
|
||||
void SetRemoteTracer(EmbedderHeapTracer* tracer) { remote_tracer_ = tracer; }
|
||||
bool InUse() { return remote_tracer_ != nullptr; }
|
||||
@ -46,17 +43,11 @@ class V8_EXPORT_PRIVATE LocalEmbedderHeapTracer final {
|
||||
// are too many of them.
|
||||
bool RequiresImmediateWrapperProcessing();
|
||||
|
||||
void NotifyV8MarkingDequeWasEmpty() { num_v8_marking_deque_was_empty_++; }
|
||||
|
||||
private:
|
||||
typedef std::vector<WrapperInfo> WrapperCache;
|
||||
|
||||
static const size_t kMaxIncrementalMarkingRounds = 10;
|
||||
|
||||
EmbedderHeapTracer* remote_tracer_;
|
||||
WrapperCache cached_wrappers_to_trace_;
|
||||
size_t num_v8_marking_deque_was_empty_;
|
||||
bool in_final_pause_;
|
||||
};
|
||||
|
||||
} // namespace internal
|
||||
|
@ -1137,12 +1137,11 @@ size_t IncrementalMarking::Step(size_t bytes_to_process,
|
||||
const bool incremental_wrapper_tracing =
|
||||
FLAG_incremental_marking_wrappers &&
|
||||
heap_->local_embedder_heap_tracer()->InUse();
|
||||
const bool v8_marking_deque_empty =
|
||||
heap_->mark_compact_collector()->marking_deque()->IsEmpty();
|
||||
const bool process_wrappers = incremental_wrapper_tracing &&
|
||||
(heap_->local_embedder_heap_tracer()
|
||||
->RequiresImmediateWrapperProcessing() ||
|
||||
v8_marking_deque_empty);
|
||||
const bool process_wrappers =
|
||||
incremental_wrapper_tracing &&
|
||||
(heap_->local_embedder_heap_tracer()
|
||||
->RequiresImmediateWrapperProcessing() ||
|
||||
heap_->mark_compact_collector()->marking_deque()->IsEmpty());
|
||||
bool wrapper_work_left = incremental_wrapper_tracing;
|
||||
if (!process_wrappers) {
|
||||
bytes_processed = ProcessMarkingDeque(bytes_to_process);
|
||||
@ -1154,8 +1153,6 @@ size_t IncrementalMarking::Step(size_t bytes_to_process,
|
||||
heap_->MonotonicallyIncreasingTimeInMs() + kStepSizeInMs;
|
||||
TRACE_GC(heap()->tracer(),
|
||||
GCTracer::Scope::MC_INCREMENTAL_WRAPPER_TRACING);
|
||||
if (v8_marking_deque_empty)
|
||||
heap_->local_embedder_heap_tracer()->NotifyV8MarkingDequeWasEmpty();
|
||||
wrapper_work_left = heap_->local_embedder_heap_tracer()->Trace(
|
||||
wrapper_deadline, EmbedderHeapTracer::AdvanceTracingActions(
|
||||
EmbedderHeapTracer::ForceCompletionAction::
|
||||
|
Loading…
Reference in New Issue
Block a user