FixStack transformation divides on phases:
- Fixing stack before break/continue
- Fixing stack for inline markers/try-catch blocks
After the first stage all ALWAYS_TRUE markers are replaced
with simple GOTO's and if we're skipping break/continue edges
we won't reach the code after while (true) statement.
At the same time it's fine to not to skip them in the second phase
as the stack for them is already corrected in the first phase
#KT-19475 Fixed
It never terminates, so the corresponding value on stack can't be used.
However, if this happens in an inlined lambda argument, the inliner is
unable to remove the corresponding ALOAD instruction (because default
handler never terminates, and thus corresponding ALOAD is not used for
lambda invocation).
KT-17573 try-finally expression in inlined function parameter argument fails with VerifyError
When a try-catch expression is passed as an argument to the inline
lambda parameter, lambda variable on stack is spilled and restored in
several different locations (1 for try-block, 1 for each catch-blocks).
So it's possible that lambda to be invoked comes from multiple loads,
all of which should have the same "root" lambda parameter.
Parse TryCatchBlockNode's in generated bytecode, infer stack save/restore points.
Save stack to local variables before 'try'.
Restore stack after the beginning of try-block, catch-block, and default handler.
Integrate before/after inline markers rewriting (otherwise it'll break our stacks).
#KT-3309 Fixed