The JIT currently will not inline a function with exception handling (EH) clauses (try/catch, try/finally, etc.). This work item is to remove that limitation.
A mechanical aspect of the implementation is simply to allow the insertion of the inlinee function EH information into the inliner EH table. Related, the inlinee must create and use its own EH table and not share the root EH table.
One specific note is that we still will not be able to inline any code with EH into an EH filter clause – that is not supported by the runtime. (I think this limitation goes back to Windows SEH, so maybe it can be considered for loosening?)
Specific work:
[ ] Give inlinee compiler its own EH table – don’t share root EH table
[ ] Support inserting inlinee EH table at a specific location in root EH table
[ ] Update inlinee IR with references to new EH table data.
This item tracks work to improve inlining in RyuJIT in .NET 10.
Inline functions containing exception handling (EH)
The JIT currently will not inline a function with exception handling (EH) clauses (try/catch, try/finally, etc.). This work item is to remove that limitation.
A mechanical aspect of the implementation is simply to allow the insertion of the inlinee function EH information into the inliner EH table. Related, the inlinee must create and use its own EH table and not share the root EH table.
One specific note is that we still will not be able to inline any code with EH into an EH filter clause – that is not supported by the runtime. (I think this limitation goes back to Windows SEH, so maybe it can be considered for loosening?)
Specific work:
Related
https://github.com/dotnet/runtime/issues/62038