Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Consistently spill the evaluation stack and save the stack pointer across escaping calls. #128681

Closed
3 tasks
markshannon opened this issue Jan 9, 2025 · 1 comment

Comments

@markshannon
Copy link
Member

Currently we mostly spill the stack (saving it to memory) and save the stack pointer (saving to frame->stackpointer) but not always.
Calls to Py_DECREF, PyStackRef_CLOSE and related functions can escape (calling arbitrary Python code and causing the GC to run), but we do not spill the stack across these "call"s.

Spilling the stack across all escaping calls is a bit of a challenge, adding a fair bit of additional complexity to the code generators.
But it is worth it as it allows means that the GC is guaranteed to be able to see every reference on the stack(s). This means that we do not need to make conservative approximations about what references are live in a frame, nor do we need to NULL out unused stack values.
It also allows us to defer many, many more references than we currently do.

Tasks

Preview Give feedback
@markshannon
Copy link
Member Author

Accidental duplicate of #128682

@markshannon markshannon closed this as not planned Won't fix, can't repro, duplicate, stale Jan 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant