◐ Shell
clean mode source ↗

GH-139922: add interpreter types to InternalDocs/interpreter.md by chris-eibl · Pull Request #148035 · python/cpython

Conversation

@chris-eibl

@chris-eibl chris-eibl commented

Apr 3, 2026

edited by bedevere-app Bot

Loading

and explain some musttail peculiarities

Fidget-Spinner

Comment on lines +536 to +539

also on the optimization level. [Introducing additional scopes](https://github.com/python/cpython/blob/3908593039bde9d4b591ab09919003ee57418d64/Python/bytecodes.c#L2526),
[extracting problematic code paths into a separate function](https://github.com/python/cpython/pull/143068/files#diff-729a985b0cb8b431cb291f1edb561bbbfea22e3f8c262451cd83328a0936a342R3724)
or [returning a pointer instead of taking it as an output parameter](https://github.com/python/cpython/blob/3908593039bde9d4b591ab09919003ee57418d64/Include/internal/pycore_ceval.h#L489-L492)
is particularly helpful to the MSVC compiler in this regard. Using `restrict` is another (currently unused) remedy.

Choose a reason for hiding this comment

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

It would be better to place this as a bullet list:

The following remedies work:
...

chris-eibl

[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,

Choose a reason for hiding this comment

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

See #148036 for a (current) list of supported MSVC configurations.

Fidget-Spinner

ljfp pushed a commit to ljfp/cpython that referenced this pull request

Apr 25, 2026

Labels

2 participants

@chris-eibl @Fidget-Spinner