Skip to content

JIT: Switch GS cookie check to use r9 to account for Swift#120745

Merged
jakobbotsch merged 3 commits into
dotnet:mainfrom
jakobbotsch:fix-swift-reg
Oct 23, 2025
Merged

JIT: Switch GS cookie check to use r9 to account for Swift#120745
jakobbotsch merged 3 commits into
dotnet:mainfrom
jakobbotsch:fix-swift-reg

Conversation

@jakobbotsch

Copy link
Copy Markdown
Member

The Swift calling convention can return values in r8 so switch the GS cookie check to use r9 for its temporary register.

Fix #120557

The Swift calling convention can return values in r8 so switch the GS
cookie check to use r9 for its temporary register.
Copilot AI review requested due to automatic review settings October 15, 2025 11:59

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR updates the JIT's GS cookie check on x64 platforms to use register r9 instead of r8 as a temporary register. This change is necessary because the Swift calling convention can return values in r8, and using it for the GS cookie check would overwrite those return values.

Key Changes

  • Changed the temporary register for GS cookie checks from r8 to r9 on AMD64 platforms
  • Updated the corresponding comment to reflect support for Swift calling convention

@github-actions github-actions Bot added the area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI label Oct 15, 2025
@dotnet-policy-service

Copy link
Copy Markdown
Contributor

Tagging subscribers to this area: @JulieLeeMSFT, @jakobbotsch
See info in area-owners.md if you want to be subscribed.

@jakobbotsch

Copy link
Copy Markdown
Member Author

/azp run runtime

@azure-pipelines

Copy link
Copy Markdown
Azure Pipelines successfully started running 1 pipeline(s).

@jakobbotsch jakobbotsch merged commit cd65a7e into dotnet:main Oct 23, 2025
110 of 112 checks passed
@jakobbotsch jakobbotsch deleted the fix-swift-reg branch October 23, 2025 15:22
@github-actions github-actions Bot locked and limited conversation to collaborators Nov 23, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-CodeGen-coreclr CLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Test failure: Interop/Swift/SwiftCallbackAbiStress/SwiftCallbackAbiStress/SwiftCallbackAbiStress.cmd

3 participants