python / python/cpython

Limit size of generated machine code to allow more efficient branching.

未关闭
#141,753 1 条评论 1 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

interpreter-core type-feature
主要语言
Python
星标
77.2k
派生
35.9k
PR 合并指标
PR 指标待抓取

描述

Most architectures have smaller and more efficient ways of branching to "near" locations than "far" locations.

In x86-64 a branch to a location within 2GB is smaller than to an arbitrary 64 bit location.
Likewise, in AArch64, a branch to within 1MB is a single instruction, but further branches will take more instructions.

We should limit the size of traces such that we can use more efficient branches in the generated machine code.

This will have little or no impact, as traces in release builds are unlikely to ever reach this limit, but we will to need enforce it for correctness, especially in debug builds.

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

未指定文件或测试。首先定位 trace 生成以及针对 x86-64 和 AArch64 的架构特定分支发射,然后确定可以在哪里强制执行 trace 大小限制。完成的标准是:生成的 trace 保持在预期的分支范围内,包括 debug 构建,同时不影响正常的 release 行为。

由索引模型根据 Issue 内容生成。

评估

技术栈
python
领域
compilers, performance
Issue 类型
功能
难度
4/5
预计耗时
3-5 天
活跃度
停滞
描述清晰度
需要澄清
新手友好度
30/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。