aboutsummaryrefslogtreecommitdiffhomepage
path: root/targets
diff options
context:
space:
mode:
authorAyke van Laethem <[email protected]>2022-10-16 00:44:38 +0200
committerRon Evans <[email protected]>2022-10-19 18:36:53 +0200
commit65d65c131345e47581835e76df5fd22fced15158 (patch)
treef3d70027c1c993959ba6657143d0ebdf3a123cea /targets
parent6b46ae261a7709d893ced7c831c4ef24a4c16d4f (diff)
downloadtinygo-65d65c131345e47581835e76df5fd22fced15158.tar.gz
tinygo-65d65c131345e47581835e76df5fd22fced15158.zip
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.
Diffstat (limited to 'targets')
-rw-r--r--targets/wasi.json3
-rw-r--r--targets/wasm.json3
2 files changed, 6 insertions, 0 deletions
diff --git a/targets/wasi.json b/targets/wasi.json
index e710b4bb1..6cec6be47 100644
--- a/targets/wasi.json
+++ b/targets/wasi.json
@@ -18,6 +18,9 @@
"--stack-first",
"--no-demangle"
],
+ "extra-files": [
+ "src/runtime/asm_tinygowasm.S"
+ ],
"emulator": "wasmtime {}",
"wasm-abi": "generic"
}
diff --git a/targets/wasm.json b/targets/wasm.json
index 2bcada5fe..26494cc45 100644
--- a/targets/wasm.json
+++ b/targets/wasm.json
@@ -19,6 +19,9 @@
"--stack-first",
"--no-demangle"
],
+ "extra-files": [
+ "src/runtime/asm_tinygowasm.S"
+ ],
"emulator": "node {root}/targets/wasm_exec.js {}",
"wasm-abi": "js"
}