Skip to content

Leave opcode question #794

Answered by ltrzesniewski
m-carrasco asked this question in Q&A
Aug 15, 2021 · 1 comments · 5 replies
Discussion options

You must be logged in to vote

ECMA-335 states the following:

The leave instruction empties the evaluation stack and ensures that the appropriate surrounding finally blocks are executed.

So this is the normative specification. I suppose the compiler just tries to emit "cleaner" IL by keeping the pop instruction (I'm also pretty sur that removing the pop instruction would require additional code in the compiler, for little benefit).

As for the OPDEF macros (which are informative BTW) Pop0 is defined as "no inputs", which is also true: the leave instruction does not really consume any input. I agree it's confusing though.

@jbevain would need to comment on where PopAll comes from, but I suppose it makes things easier to…

Replies: 1 comment 5 replies

Comment options

You must be logged in to vote
5 replies
@m-carrasco
Comment options

@jbevain
Comment options

@jbevain
Comment options

@ltrzesniewski
Comment options

@m-carrasco
Comment options

Answer selected by m-carrasco
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants