Commit fe3544b3 authored by jochen's avatar jochen Committed by Commit bot

Make tests pass with weak closure overapproximation enabled

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

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

Cr-Commit-Position: refs/heads/master@{#27261}
parent e093b6d3
......@@ -4543,11 +4543,12 @@ void Heap::IdleMarkCompact(const char* message) {
bool Heap::TryFinalizeIdleIncrementalMarking(
double idle_time_in_ms, size_t size_of_objects,
size_t final_incremental_mark_compact_speed_in_bytes_per_ms) {
if (incremental_marking()->IsReadyToOverApproximateWeakClosure() ||
(FLAG_overapproximate_weak_closure &&
mark_compact_collector_.marking_deque()->IsEmpty() &&
gc_idle_time_handler_.ShouldDoOverApproximateWeakClosure(
static_cast<size_t>(idle_time_in_ms)))) {
if (FLAG_overapproximate_weak_closure &&
(incremental_marking()->IsReadyToOverApproximateWeakClosure() ||
(!incremental_marking()->weak_closure_was_overapproximated() &&
mark_compact_collector_.marking_deque()->IsEmpty() &&
gc_idle_time_handler_.ShouldDoOverApproximateWeakClosure(
static_cast<size_t>(idle_time_in_ms))))) {
OverApproximateWeakClosure(
"Idle notification: overapproximate weak closure");
return true;
......
......@@ -42,6 +42,10 @@ class IncrementalMarking {
return weak_closure_was_overapproximated_;
}
void SetWeakClosureWasOverApproximatedForTesting(bool val) {
weak_closure_was_overapproximated_ = val;
}
inline bool IsStopped() { return state() == STOPPED; }
INLINE(bool IsMarking()) { return state() >= MARKING; }
......@@ -51,7 +55,8 @@ class IncrementalMarking {
inline bool IsComplete() { return state() == COMPLETE; }
inline bool IsReadyToOverApproximateWeakClosure() const {
return request_type_ == OVERAPPROXIMATION;
return request_type_ == OVERAPPROXIMATION &&
!weak_closure_was_overapproximated_;
}
GCRequestType request_type() const { return request_type_; }
......
......@@ -558,6 +558,9 @@ static inline void SimulateIncrementalMarking(i::Heap* heap) {
CHECK(marking->IsMarking());
while (!marking->IsComplete()) {
marking->Step(i::MB, i::IncrementalMarking::NO_GC_VIA_STACK_GUARD);
if (marking->IsReadyToOverApproximateWeakClosure()) {
marking->MarkObjectGroups();
}
}
CHECK(marking->IsComplete());
}
......
......@@ -2341,6 +2341,8 @@ TEST(IdleNotificationFinishMarking) {
CHECK(!marking->IsIdleMarkingDelayCounterLimitReached());
}
marking->SetWeakClosureWasOverApproximatedForTesting(true);
// The next idle notification has to finish incremental marking.
const int kLongIdleTime = 1000000;
CcTest::isolate()->IdleNotification(kLongIdleTime);
......@@ -4063,7 +4065,8 @@ TEST(IncrementalMarkingStepMakesBigProgressWithLargeObjects) {
if (marking->IsStopped()) marking->Start();
// This big step should be sufficient to mark the whole array.
marking->Step(100 * MB, IncrementalMarking::NO_GC_VIA_STACK_GUARD);
DCHECK(marking->IsComplete());
DCHECK(marking->IsComplete() ||
marking->IsReadyToOverApproximateWeakClosure());
}
......
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