mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-07 04:23:41 +00:00
wasm: fix GC scanning of allocas
Scanning of allocas was entirely broken on WebAssembly. The code intended to do this was never run. There were also no tests. Looking into this further, I found that it is actually not really necessary to do that: the C stack can be scanned conservatively and in fact this was already done for goroutine stacks (because they live on the heap and are always referenced). It wasn't done for the system stack however. With these fixes, I believe code should be both faster *and* more correct. I found this in my work to get opaque pointers supported in LLVM 15, because the code that was never reached now finally got run and was actually quite buggy.
This commit is contained in:
committed by
Ron Evans
parent
6b46ae261a
commit
65d65c1313
@@ -0,0 +1,10 @@
|
||||
.globaltype __stack_pointer, i32
|
||||
|
||||
.global tinygo_getCurrentStackPointer
|
||||
.hidden tinygo_getCurrentStackPointer
|
||||
.type tinygo_getCurrentStackPointer,@function
|
||||
tinygo_getCurrentStackPointer: // func getCurrentStackPointer() uintptr
|
||||
.functype tinygo_getCurrentStackPointer() -> (i32)
|
||||
global.get __stack_pointer
|
||||
return
|
||||
end_function
|
||||
Reference in New Issue
Block a user