Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Implement EmbedderRootsHandler::TryResetRoot(). #756

Merged
merged 1 commit into from
Jun 10, 2023
Merged

Conversation

kentonv
Copy link
Member

@kentonv kentonv commented Jun 9, 2023

In V8 11.5, things changed so that the ResetRoot() callback might be called on a background thread. A new method, TryResetRoot(), can be implemented to return false in order to prevent this and force ResetRoot() back to the main thread. However, its default implementation just calls ResetRoot() (on the background thread), hence the default behavior changed.

https://chromium-review.googlesource.com/c/v8/v8/+/4474708

Our ResetRoot() must be called on the main thread, so we must implement TryResetRoot() to return false.

This allows us to remove the single_threaded_gc flag we added recently as a work-around. It turns out that flag isn't actually sufficient to avoid the problem anyway.

In V8 11.5, things changed so that the `ResetRoot()` callback might be called on a background thread. A new method, `TryResetRoot()`, can be implemented to return false in order to prevent this and force `ResetRoot()` back to the main thread. However, its default implementation just calls `ResetRoot()` (on the background thread), hence the default behavior changed.

https://chromium-review.googlesource.com/c/v8/v8/+/4474708

Our `ResetRoot()` must be called on the main thread, so we must implement `TryResetRoot()` to return false.

This allows us to remove the `single_threaded_gc` flag we added recently as a work-around. It turns out that flag isn't actually sufficient to avoid the problem anyway.
@kentonv kentonv requested a review from ohodson June 9, 2023 18:06
@kentonv kentonv merged commit fad0aa1 into main Jun 10, 2023
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants