Revisit EH at P/Invoke boundary for QCalls
- Dominant language
- C#
- Stars
- 18.3k
- Forks
- 5.6k
- PR merge metrics
- PR metrics pending
Description
> we don't push them on pinvoke boundary for perf reason (@jkotas believed the perf hit would not be acceptable
On Unix, we would have to get rid of the internal EH interop for QCalls to do this correctly: catch the exception on QCall unmanaged side, store it in a thread local variable or in an `[out]` argument register, and rethrow it on the managed size.
Also, we would have the do something about the other managed->unmanaged transitions that do not go through the regular PInvoke path. For the less perf-sensitive transitions like `ThePreStub`, it should be ok to push the callee saved float registers.
_Originally posted by @jkotas in https://github.com/dotnet/runtime/pull/123307#discussion_r2705835559_
Contributor guide
Assessment
This issue has not been assessed yet.