[interp] Add separate opcode for pop vt (#36760)
authormonojenkins <jo.shields+jenkins@xamarin.com>
Wed, 20 May 2020 21:35:59 +0000 (17:35 -0400)
committerGitHub <noreply@github.com>
Wed, 20 May 2020 21:35:59 +0000 (00:35 +0300)
commitcf654f08fb0078a96a4e414a0d2eab5e6c069387
tree6bd3cc10228ef71ab33ea831fe8eadc6852e2f1a
parent54db4a39f86f07ca2a7d91c4620268d87ff324b2
[interp] Add separate opcode for pop vt (#36760)

Before this change, pop-ing a vt from the stack was done in 2 opcodes, a MINT_POP (decrementing the stack) and the weird MINT_VTRESULT (decrementing the vtstack). However, optimizations could have removed both the initial loading of the value type on the stack as well as the MINT_POP, leaving MINT_VTRESULT underflowing the vtstack. Fix this and cleanup the code by pop-ing a value type from the stack in a single instruction.

Co-authored-by: BrzVlad <BrzVlad@users.noreply.github.com>
src/mono/mono/mini/interp/interp.c
src/mono/mono/mini/interp/mintops.def
src/mono/mono/mini/interp/transform.c