Introduce BBJ_EHFAULTRET (#84467)
authorBruce Forstall <brucefo@microsoft.com>
Fri, 7 Apr 2023 21:56:17 +0000 (14:56 -0700)
committerGitHub <noreply@github.com>
Fri, 7 Apr 2023 21:56:17 +0000 (14:56 -0700)
commitf4021904d0654df8f6c0a36ecc0e2c48eafbb49d
treee792ffb4cd494c4ba0115e5d08ce8fff2617a263
parent35f5a561b8a60f8c0de055c691afb44ee7f4ae4e
Introduce BBJ_EHFAULTRET (#84467)

The IL `endfinally` and `endfault` instructions are aliases,
imported in the JIT IR as `BBJ_EHFINALLYRET`.

Introduce `BBJ_EHFAULTRET` for cases within `fault` clauses.

This simplifies some code, and makes it more clear when writing
code that `fault` clauses need to be considered, separately from
`finally` clauses.

To do this, after importing EH clauses, convert any `BBJ_EHFINALLYRET`
as necessary. Also, try/finally cloning, which (sometimes) converts
`finally` clauses to `fault` clauses, needs to update the corresponding
`BBJ_EHFINALLYRET`. When creating new try/fault clauses for synchronized
functions, use `BBJ_EHFAULTRET` now.

Fixes #84307
18 files changed:
src/coreclr/jit/block.cpp
src/coreclr/jit/block.h
src/coreclr/jit/codegencommon.cpp
src/coreclr/jit/codegenlinear.cpp
src/coreclr/jit/codegenxarch.cpp
src/coreclr/jit/fgbasic.cpp
src/coreclr/jit/fgdiagnostic.cpp
src/coreclr/jit/fgehopt.cpp
src/coreclr/jit/fgflow.cpp
src/coreclr/jit/fgopt.cpp
src/coreclr/jit/fgprofile.cpp
src/coreclr/jit/fgprofilesynthesis.cpp
src/coreclr/jit/flowgraph.cpp
src/coreclr/jit/importer.cpp
src/coreclr/jit/jiteh.cpp
src/coreclr/jit/liveness.cpp
src/coreclr/jit/lsrabuild.cpp
src/coreclr/jit/optimizer.cpp