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
分支
36k
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 摘要。