Commit 27fca37d authored by Dominik Inführ's avatar Dominik Inführ Committed by Commit Bot

[heap] Fix flaky test for GC epilogues

Ensure that epilogues are added to the LocalHeap before starting the GC.
Adding the epilogue after invoking NotifyStarted() might mean that the
epilogue is only added after the GC is already done and the epilogue
isn't run at all. The test flakily fails because the epilogue didn't
execute then.

Bug: v8:11434
Change-Id: I60723a99cd9224307f48acd0c0e8af3f93dd3eb2
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/2690600
Commit-Queue: Dominik Inführ <dinfuehr@chromium.org>
Reviewed-by: 's avatarUlan Degenbaev <ulan@chromium.org>
Cr-Commit-Position: refs/heads/master@{#72688}
parent 3e6fe261
......@@ -131,12 +131,12 @@ class BackgroundThreadForGCEpilogue final : public v8::base::Thread {
if (!parked_) {
unparked_scope.emplace(&lh);
}
epilogue_->NotifyStarted();
{
base::Optional<UnparkedScope> unparked_scope;
if (parked_) unparked_scope.emplace(&lh);
lh.AddGCEpilogueCallback(&GCEpilogue::Callback, epilogue_);
}
epilogue_->NotifyStarted();
while (!epilogue_->StopRequested()) {
lh.Safepoint();
}
......
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