Skip to content

Commit

Permalink
Backend: Prepare if_ and block_ for multi-value (#2853)
Browse files Browse the repository at this point in the history
These Wasm nodes need to be annotated with their return type, and if the
return type is more than nullary or unary, then this type needs to be
defined in the Wasm module type table.

This refactors the story around `if_` etc. to allow that:
`E.if_ env tys thn else` will register the types as needed

But in many places we know statically that there is only zero or one
return type. For them, `G.if0` and `G.if1` can be used for cleaner code
and to emphasize their “purity”. In a similar vein, `G.loop0` is introduced;
since our loops never produce values on the stack, there is no `loop_` with
multi-value result.

Extracted from #1459, but I’d like to have it on master to prevent merge
conflicts in #1459 (which is a long-running branch since May 2020…)
  • Loading branch information
nomeata authored Oct 23, 2021
1 parent 5d8d976 commit a3f0595
Show file tree
Hide file tree
Showing 3 changed files with 139 additions and 129 deletions.
Loading

0 comments on commit a3f0595

Please sign in to comment.