Skip to content

Conversation

@DougGregor
Copy link
Member

Prior to throwing, Swift emits a call to swift_willThrow(Typed), which allows various diagnostic tools (such as debuggers and testing libraries) to intercept errors at the point where they are initially thrown.

Since swift_willThrow(Typed) can be hooked by arbitrary code at runtime, there is no way for it to meet performance constraints like @_noLocks or @_noAllocation. Therefore, in a function that has those performance constraints specified, disable emission of the call to swift_willThrow(Typed).

Fixes rdar://140230684.

Prior to throwing, Swift emits a call to `swift_willThrow(Typed)`,
which allows various diagnostic tools (such as debuggers and testing
libraries) to intercept errors at the point where they are initially
thrown.

Since `swift_willThrow(Typed)` can be hooked by arbitrary code at
runtime, there is no way for it to meet performance constraints like
@_noLocks or @_noAllocation. Therefore, in a function that has those
performance constraints specified, disable emission of the call to
`swift_willThrow(Typed)`.

Fixes rdar://140230684.
@DougGregor DougGregor requested review from a team and eeckstein as code owners November 21, 2024 18:20
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor requested a review from jckarter as a code owner November 21, 2024 20:40
@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor
Copy link
Member Author

@swift-ci please smoke test

@DougGregor DougGregor merged commit 657adcb into swiftlang:main Nov 22, 2024
3 checks passed
@DougGregor DougGregor deleted the willthrow-no-locks branch November 22, 2024 17:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant