Wasm requires an end instruction to be placed as a delimiter for the end of an expression. One consequence of this for us in the JIT is that we need to emit an end instruction at the end of codegen for the main portion of a method, as the method body itself is implicitly an expression. In the case of funclets, end will need to be emitted before any funclet code.
Currently, as of #122425, we emit end as part of the epilog generation code if there are no attached funclet blocks. We need to make sure that (at least) the following two cases are handled:
Wasm requires an
endinstruction to be placed as a delimiter for the end of an expression. One consequence of this for us in the JIT is that we need to emit anendinstruction at the end of codegen for the main portion of a method, as the method body itself is implicitly an expression. In the case of funclets,endwill need to be emitted before any funclet code.Currently, as of #122425, we emit
endas part of the epilog generation code if there are no attached funclet blocks. We need to make sure that (at least) the following two cases are handled:endeven for methods that don't have epiloguesendto terminate funclets