Browse Source
This commit implements a scheme I've been meaning to work on in the adapter compiler where instead of always generating a fresh local for all operations locals may now be reused. Locals generated are explicitly free'd when their lexical scope has ended, allowing reuse in translation of later types in the adapter. This also implements a new scheme for initializing locals where previously a local could simply be generated, but now the local must be fused with its initializer where a `local.{tee,set}` instruction is always generated. This should help prevent a bug I ran into with strings where one usage of a local was forgotten to be initialized which meant that when it was used during a loop it may have had a stale value from before. Modeling this in Rust isn't possible at compile time unfortunately so I opted for the next best thing, runtime panics. If a local is accidentally not released back to the pool of free locals then it will panic. The fuzzer for simply generating and validating adapter modules should be good at exercising this and it weeded out a few forgotten free's and should be good now.pull/4648/head
Alex Crichton
2 years ago
committed by
GitHub
1 changed files with 373 additions and 290 deletions
File diff suppressed because it is too large
Loading…
Reference in new issue