Skip to content

Fix two issues in --spill-pointers #5315

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

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

juj
Copy link
Collaborator

@juj juj commented Dec 2, 2022

Fix two issues in --spill-pointers: 1) properly generate the stack frame in a stack-grows-downwards manner, and 2) do not spill pointers in the functions stackAlloc()/stackSave()/stackRestore(), which should operate on the global stack pointer without a stack frame of their own.

@hoodmane
Copy link

What is the status of this patch? Has anyone investigated the CI failures? Thanks for working on this @juj! It looks helpful.

@juj juj force-pushed the spill_pointers_fixes branch from 8dff0a2 to 6d91ceb Compare February 20, 2024 22:20
@juj
Copy link
Collaborator Author

juj commented Feb 20, 2024

Took quite a bit of time to get back to looking into GC on Emscripten..

I see that in current main branch, the issue 1) has already been fixed.

So I reset this branch now on top of latest main, and only kept the second fix

"2) do not spill pointers in the functions stackAlloc()/stackSave()/stackRestore(), which should operate on the global stack pointer without a stack frame of their own."

from the original code.

I am developing a small toy garbage collector to test things out, and with this Binaryen PR landed, it is now working properly to scan the local stack and global static data section.

@juj
Copy link
Collaborator Author

juj commented Feb 20, 2024

I am testing this out against https://github.com/juj/emgc to prototype garbage collection against Emscripten. The plan is to experiment with multithreaded garbage collection from multiple managed threads, with cooperative stop-the-world signaling, and then try to transplant the whole thing back to Boehm, or something like that.

@kripken
Copy link
Member

kripken commented Feb 20, 2024

@juj Are you aiming to get this approved and landed here in upstream, or is this just for experimentation at this time?

@juj
Copy link
Collaborator Author

juj commented Feb 21, 2024

This is now for experimentation, though I'll try to work towards test cases on the stackAlloc issue to make sure I'm proposing a fix that patches that issue.

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

Successfully merging this pull request may close these issues.

3 participants