Fix two issues in --spill-pointers
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.
What is the status of this patch? Has anyone investigated the CI failures? Thanks for working on this @juj! It looks helpful.
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.
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.
@juj Are you aiming to get this approved and landed here in upstream, or is this just for experimentation at this time?
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.