Details
-
Technical task
-
Resolution: Unresolved
-
P2: Important
-
None
Description
The key to supporting unwind handlers is the realization that each unwind handler can be represented by a single conditional jump in the basic block analysis.
Once the unwind handler is set, each instruction that potentially generates an exception may immediately jump to the unwind handler. However, since each instruction may jump there, we cannot assume anything about the state of the registers used inside the code covered by the unwind handler when entering the unwind handler. From the perspective of data flow analysis it therefore looks exactly like we were jumping from the point where the unwind handler is set.
We may still need to re-order some byte code instructions if they make implicit assumptions. For example storing a register cannot throw an exception, but we would like to know about the stored register before setting the unwind handler.