Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -167,14 +167,12 @@ jobs:
- true
interpreter:
- switch-case
- tail-call
exclude:
# Skip Win32 on free-threaded builds
- { arch: Win32, free-threading: true }
include:
# msvc::musttail is currently only supported on x64,
# and only supported on 3.15+.
- { arch: x64, free-threading: false, interpreter: tail-call }
- { arch: x64, free-threading: true, interpreter: tail-call }
# Skip Win32 on tail-call interpreter builds
- { arch: Win32, interpreter: tail-call }
uses: $/.github/workflows/reusable-windows.yml
with:
arch: ${{ matrix.arch }}
Expand Down
11 changes: 11 additions & 0 deletions .github/workflows/reusable-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,17 @@ jobs:
- name: Register MSVC problem matcher
if: inputs.arch != 'Win32'
run: echo "::add-matcher::.github/problem-matchers/msvc.json"
- name: Select native ARM64 MSBuild
if: inputs.arch == 'arm64'
shell: pwsh
run: |
# The x86-hosted linker can run out of heap space during LTCG.
$vswhere = "${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe"
$msbuild = & $vswhere -latest -products '*' -requires Microsoft.VisualStudio.Component.VC.Tools.ARM64 -find 'MSBuild\Current\Bin\arm64\MSBuild.exe'
if (!$msbuild -or !(Test-Path -LiteralPath $msbuild -PathType Leaf)) {
throw 'Native ARM64 MSBuild was not found.'
}
('MSBUILD="{0}"' -f $msbuild) >> $env:GITHUB_ENV
- name: Build CPython
# msvc::musttail is not supported for debug builds, so we have to
# switch to release.
Expand Down
5 changes: 3 additions & 2 deletions InternalDocs/interpreter.md
Original file line number Diff line number Diff line change
Expand Up @@ -525,8 +525,9 @@ There are three different types of interpreters to choose from based on compiler
[preserve_none](https://clang.llvm.org/docs/AttributeReference.html#preserve-none)
calling convention between the small C functions that implement individual Python opcodes.

Not all compilers support these and if they do not all targets might be supported (for example,
MSVC currently only supports x64 and only in optimized builds).
Support depends on the compiler and target architecture. With MSVC, the
tail-calling interpreter is available only in optimized builds. The minimum
MSVC version is 14.50 for x64 and 14.52 for ARM64.

In addition, compilers must do [escape analysis](https://gcc.gnu.org/onlinedocs/gcc/Common-Attributes.html#index-musttail)
of the lifetimes of automatic variables, function parameters, and temporaries to ensure proper tail-calls. They
Expand Down
Loading