Commit 82fe1adf authored by jochen's avatar jochen Committed by Commit bot

Repeatedly overapproximate the weak closure as long as we make progress

Also, include the time for building object groups in the tracing scope
for the overapproximation.

BUG=v8:3862
R=hpayer@chromium.org
LOG=n

Review URL: https://codereview.chromium.org/1012593004

Cr-Commit-Position: refs/heads/master@{#27218}
parent 49792792
......@@ -613,6 +613,11 @@ DEFINE_BOOL(incremental_marking, true, "use incremental marking")
DEFINE_BOOL(incremental_marking_steps, true, "do incremental marking steps")
DEFINE_BOOL(overapproximate_weak_closure, false,
"overapproximate weak closer to reduce atomic pause time")
DEFINE_INT(min_progress_during_object_groups_marking, 128,
"keep overapproximating the weak closure as long as we discover at "
"least this many unmarked objects")
DEFINE_INT(max_object_groups_marking_rounds, 3,
"at most try this many times to over approximate the weak closure")
DEFINE_BOOL(concurrent_sweeping, true, "use concurrent sweeping")
DEFINE_BOOL(trace_incremental_marking, false,
"trace progress of the incremental marking")
......
......@@ -766,6 +766,10 @@ void Heap::OverApproximateWeakClosure(const char* gc_reason) {
PrintF("[IncrementalMarking] Overapproximate weak closure (%s).\n",
gc_reason);
}
GCTracer::Scope gc_scope(tracer(),
GCTracer::Scope::MC_INCREMENTAL_WEAKCLOSURE);
{
GCCallbacksScope scope(this);
if (scope.CheckReenter()) {
......
......@@ -30,6 +30,7 @@ IncrementalMarking::IncrementalMarking(Heap* heap)
unscanned_bytes_of_large_object_(0),
was_activated_(false),
weak_closure_was_overapproximated_(false),
weak_closure_approximation_rounds_(0),
request_type_(COMPLETE_MARKING) {}
......@@ -549,8 +550,8 @@ void IncrementalMarking::MarkObjectGroups() {
DCHECK(FLAG_overapproximate_weak_closure);
DCHECK(!weak_closure_was_overapproximated_);
GCTracer::Scope gc_scope(heap_->tracer(),
GCTracer::Scope::MC_INCREMENTAL_WEAKCLOSURE);
int old_marking_deque_top =
heap_->mark_compact_collector()->marking_deque()->top();
heap_->mark_compact_collector()->MarkImplicitRefGroups(&MarkObject);
......@@ -558,10 +559,19 @@ void IncrementalMarking::MarkObjectGroups() {
heap_->isolate()->global_handles()->IterateObjectGroups(
&visitor, &MarkCompactCollector::IsUnmarkedHeapObjectWithHeap);
int marking_progress =
abs(old_marking_deque_top -
heap_->mark_compact_collector()->marking_deque()->top());
++weak_closure_approximation_rounds_;
if ((weak_closure_approximation_rounds_ >=
FLAG_max_object_groups_marking_rounds) ||
(marking_progress < FLAG_min_progress_during_object_groups_marking)) {
weak_closure_was_overapproximated_ = true;
}
heap_->isolate()->global_handles()->RemoveImplicitRefGroups();
heap_->isolate()->global_handles()->RemoveObjectGroups();
weak_closure_was_overapproximated_ = true;
}
......@@ -819,6 +829,7 @@ void IncrementalMarking::MarkingComplete(CompletionAction action) {
void IncrementalMarking::Epilogue() {
was_activated_ = false;
weak_closure_was_overapproximated_ = false;
weak_closure_approximation_rounds_ = 0;
}
......
......@@ -41,9 +41,6 @@ class IncrementalMarking {
bool weak_closure_was_overapproximated() const {
return weak_closure_was_overapproximated_;
}
void set_weak_closure_was_overapproximated(bool val) {
weak_closure_was_overapproximated_ = val;
}
inline bool IsStopped() { return state() == STOPPED; }
......@@ -249,6 +246,8 @@ class IncrementalMarking {
bool weak_closure_was_overapproximated_;
int weak_closure_approximation_rounds_;
GCRequestType request_type_;
DISALLOW_IMPLICIT_CONSTRUCTORS(IncrementalMarking);
......
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