tinygo/src/runtime
Ayke van Laethem 65d65c1313 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.
2022-10-19 18:36:53 +02:00
..
cgo runtime/cgo: go fmt 2018-09-14 20:58:00 +02:00
debug src/runtime: add stub for debug.ReadBuildInfo() 2022-03-07 20:03:51 +01:00
internal/sys all: check formatting on CI 2019-04-13 19:58:58 +02:00
interrupt all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
pprof runtime/pprof, runtime/trace: stub some additional functions 2022-09-02 10:37:50 +02:00
trace runtime/pprof, runtime/trace: stub some additional functions 2022-09-02 10:37:50 +02:00
volatile all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
algorithm.go src/runtime: switch to stronger hash function 2022-06-17 08:46:41 +02:00
arch_386.go avr: add support for recover() 2022-06-19 11:51:12 +02:00
arch_amd64.go avr: add support for recover() 2022-06-19 11:51:12 +02:00
arch_arm.go avr: add support for recover() 2022-06-19 11:51:12 +02:00
arch_arm64.go avr: add support for recover() 2022-06-19 11:51:12 +02:00
arch_avr.go avr: add support for recover() 2022-06-19 11:51:12 +02:00
arch_cortexm.go avr: add support for recover() 2022-06-19 11:51:12 +02:00
arch_tinygoriscv.go avr: add support for recover() 2022-06-19 11:51:12 +02:00
arch_tinygoriscv32.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
arch_tinygoriscv64.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
arch_tinygowasm.go wasm: fix GC scanning of allocas 2022-10-19 18:36:53 +02:00
arch_xtensa.go avr: add support for recover() 2022-06-19 11:51:12 +02:00
asm_386.S runtime: load sp and pc inside tinygo_longjmp 2022-06-19 11:51:12 +02:00
asm_amd64.S runtime: load sp and pc inside tinygo_longjmp 2022-06-19 11:51:12 +02:00
asm_amd64_windows.S runtime: load sp and pc inside tinygo_longjmp 2022-06-19 11:51:12 +02:00
asm_arm.S runtime: load sp and pc inside tinygo_longjmp 2022-06-19 11:51:12 +02:00
asm_arm64.S runtime: load sp and pc inside tinygo_longjmp 2022-06-19 11:51:12 +02:00
asm_avr.S avr: add support for recover() 2022-06-19 11:51:12 +02:00
asm_riscv.S runtime: load sp and pc inside tinygo_longjmp 2022-06-19 11:51:12 +02:00
asm_tinygowasm.S wasm: fix GC scanning of allocas 2022-10-19 18:36:53 +02:00
atomics_critical.go rumtime: implement __sync libcalls as critical sections 2021-12-28 22:12:03 +01:00
baremetal.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
build_asserts.go runtime: make gc and scheduler asserts settable with build tags 2022-09-25 16:47:07 +02:00
build_noasserts.go runtime: make gc and scheduler asserts settable with build tags 2022-09-25 16:47:07 +02:00
chan.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
complex.go compiler: implement complex division 2019-05-11 15:33:37 +02:00
cond.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
cond_nosched.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
debug.go updating the comments for stub funcs 2022-03-19 19:09:20 +01:00
defer.go compiler: avoid function pointers in defer calls 2018-12-09 16:44:37 +01:00
dynamic_arm64.go nintendoswitch: Add env parser and removed unused stuff 2020-11-03 23:28:55 +01:00
env_linux.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
error.go extend stdlib to allow import of more packages (#1099) 2020-06-23 11:56:28 +02:00
extern.go src/runtime: add runtime.Version() 2022-03-19 15:36:44 +01:00
float.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
func.go compiler: decouple func lowering from interface type codes 2021-04-12 12:07:42 +02:00
gc_conservative.go runtime: switch some panic() calls in the gc to runtimePanic() for consistency 2022-10-19 12:54:17 +02:00
gc_globals.go gc: drop support for 'precise' globals 2022-06-01 21:21:30 +02:00
gc_leaking.go runtime: make gc and scheduler asserts settable with build tags 2022-09-25 16:47:07 +02:00
gc_none.go runtime: make gc and scheduler asserts settable with build tags 2022-09-25 16:47:07 +02:00
gc_stack_portable.go wasm: fix GC scanning of allocas 2022-10-19 18:36:53 +02:00
gc_stack_raw.go runtime: remove extalloc 2021-12-17 18:15:18 +01:00
hashmap.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
hosted.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
interface.go reflect: add Value.UnsafePointer method 2022-06-12 01:08:02 +02:00
memhash_fnv.go src/runtime: add leveldb memhash 2022-06-17 08:46:41 +02:00
memhash_leveldb.go runtime: add comments about the hash functions 2022-06-17 08:46:41 +02:00
memhash_tsip.go runtime: add comments about the hash functions 2022-06-17 08:46:41 +02:00
mstats.go runtime: add MemStats.Mallocs and Frees 2022-08-20 11:41:20 +02:00
mstats_conservative.go runtime: add MemStats.Mallocs and Frees 2022-08-20 11:41:20 +02:00
mstats_leaking.go runtime: add MemStats.Mallocs and Frees 2022-08-20 11:41:20 +02:00
nonhosted.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
os_darwin.c darwin: fix syscall.Open on darwin/arm64 2022-10-13 21:07:38 +02:00
os_darwin.go darwin: fix syscall.Open on darwin/arm64 2022-10-13 21:07:38 +02:00
os_js.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
os_linux.go runtime: scan all writable program segments 2022-06-16 07:59:21 +02:00
os_other.go gc: drop support for 'precise' globals 2022-06-01 21:21:30 +02:00
os_windows.go syscall.Getpagesize(): add test, implement for Linux and Windows 2022-06-12 01:15:42 +02:00
panic.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
poll.go runtime: remove ctx param from stub code 2019-01-14 20:56:42 +01:00
print.go runtime: rename printuint to printuintptr 2022-07-15 15:44:40 +02:00
runtime.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
runtime_arm7tdmi.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
runtime_atmega.go serial: use common initialization for serial 2022-07-05 20:53:37 +02:00
runtime_atsamd21.go samd21,samd51,nrf52840: move usbcdc to machine/usb/cdc (#2972) 2022-07-10 11:33:52 +02:00
runtime_atsamd21e18.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
runtime_atsamd21g18.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
runtime_atsamd51.go samd21,samd51,nrf52840: move usbcdc to machine/usb/cdc (#2972) 2022-07-10 11:33:52 +02:00
runtime_atsamd51g19.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
runtime_atsamd51j19.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
runtime_atsamd51j20.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
runtime_atsamd51p19.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
runtime_atsamd51p20.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
runtime_atsame5x_can.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
runtime_atsame51j19.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
runtime_atsame54p20.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
runtime_attiny.go os, runtime: enable os.Stdin for baremetal target 2022-06-01 07:56:25 +02:00
runtime_avr.go avr: simplify timer-based time 2022-05-25 11:53:30 +02:00
runtime_cortexm.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
runtime_cortexm_abort.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
runtime_cortexm_hardfault.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
runtime_cortexm_hardfault_debug.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
runtime_cortexm_qemu.go os, runtime: enable os.Stdin for baremetal target 2022-06-01 07:56:25 +02:00
runtime_esp32.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
runtime_esp32c3.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
runtime_esp32xx.go os, runtime: enable os.Stdin for baremetal target 2022-06-01 07:56:25 +02:00
runtime_esp8266.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
runtime_fe310.go serial: use common initialization for serial 2022-07-05 20:53:37 +02:00
runtime_fe310_baremetal.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
runtime_fe310_qemu.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
runtime_k210.go serial: use common initialization for serial 2022-07-05 20:53:37 +02:00
runtime_k210_baremetal.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
runtime_mimxrt1062.go serial: use common initialization for serial 2022-07-05 20:53:37 +02:00
runtime_mimxrt1062_clock.go board/teensy40: Add I2C support (#1471) 2022-06-22 11:28:50 +02:00
runtime_mimxrt1062_mpu.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
runtime_mimxrt1062_time.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
runtime_nintendoswitch.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
runtime_nintendoswitch.S all: rename assembly files to .S extension 2022-08-04 15:43:42 +02:00
runtime_nrf.go samd21,samd51,nrf52840: refactor usb initialization 2022-07-06 17:55:25 +02:00
runtime_nrf52840.go samd21,samd51,nrf52840: move usbcdc to machine/usb/cdc (#2972) 2022-07-10 11:33:52 +02:00
runtime_nrf_bare.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
runtime_nrf_softdevice.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
runtime_nxpmk66f18.go os, runtime: enable os.Stdin for baremetal target 2022-06-01 07:56:25 +02:00
runtime_rp2040.go rp2040: add support for usb (#2973) 2022-07-12 15:41:56 +02:00
runtime_stm32.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
runtime_stm32_timers.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
runtime_stm32f4.go serial: use common initialization for serial 2022-07-05 20:53:37 +02:00
runtime_stm32f7x2.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
runtime_stm32f103.go serial: use common initialization for serial 2022-07-05 20:53:37 +02:00
runtime_stm32f405.go serial: use common initialization for serial 2022-07-05 20:53:37 +02:00
runtime_stm32f407.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
runtime_stm32f469.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
runtime_stm32l0.go os, runtime: enable os.Stdin for baremetal target 2022-06-01 07:56:25 +02:00
runtime_stm32l0x1.go serial: use common initialization for serial 2022-07-05 20:53:37 +02:00
runtime_stm32l0x2.go serial: use common initialization for serial 2022-07-05 20:53:37 +02:00
runtime_stm32l4.go serial: use common initialization for serial 2022-07-05 20:53:37 +02:00
runtime_stm32l4x2.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
runtime_stm32l4x5.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
runtime_stm32l5x2.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
runtime_stm32wlx.go serial: use common initialization for serial 2022-07-05 20:53:37 +02:00
runtime_tinygoriscv.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
runtime_tinygoriscv64.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
runtime_tinygoriscv_qemu.go os, runtime: enable os.Stdin for baremetal target 2022-06-01 07:56:25 +02:00
runtime_tinygowasm.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
runtime_unix.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
runtime_wasm_js.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
runtime_wasm_js_scheduler.go wasm: support -scheduler=none 2021-11-17 19:03:20 +01:00
runtime_wasm_wasi.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
runtime_windows.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
scheduler.go runtime: add support for time.NewTimer and time.NewTicker 2022-08-23 12:37:25 +02:00
scheduler_any.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
scheduler_none.go avr: fix time.Sleep() in init code 2022-01-02 19:41:44 +01:00
scheduler_tasks.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00
slice.go compiler, runtime: add layout parameter to runtime.alloc 2021-11-02 22:16:15 +01:00
stack.go runtime: add stubs for Func.FileLine and Frame.PC 2022-01-18 14:38:13 +01:00
string.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
symtab.go runtime: add stubs for Func.FileLine and Frame.PC 2022-01-18 14:38:13 +01:00
sync.go all: basic support for the os package 2018-09-16 13:01:03 +02:00
time.go runtime: implement resetTimer 2022-08-25 11:30:33 +02:00
time_nxpmk66f18.go all: format code according to Go 1.19 rules 2022-08-04 12:18:32 +02:00
timer.go all: drop support for Go 1.16 and Go 1.17 2022-08-30 12:38:06 +02:00
wait_other.go all: update build constraints to Go 1.17 2022-02-04 07:49:46 +01:00