bytecodealliance / bytecodealliance/regalloc2
Replace manual use of index newtypes `bundles[bundle.index()]` with `Index` impls and typed `Vec` wrappers
- 主要语言
- Rust
- 星标
- 265
- 派生
- 53
- PR 合并指标
- 30 天内没有已合并 PR
描述
Right now, regalloc2 uses an entity-component-system sort of pattern with toplevel `Vec`s of `LiveBundle`, `VRegData`, and the like, and newtype'd index wrappers like `LiveBundleIndex`, `VRegIndex`, etc. We have a whole bunch of instances of `self.bundles[bundle.index()]...`.
Ideally we would make `bundles` a `Vec`-wrapper type that has an `Index` implementation that natively takes `LiveBundleIndex`, and then we could make all of these sites slightly less verbose.
贡献指南
这个仓库没有索引到贡献指南
调研方向
在仓库中搜索 self.bundles[bundle.index()] 的出现位置以及类似的手动索引方式,然后检查 LiveBundleIndex、VRegIndex 和相关的索引 newtype。根据这些用法确定带类型的 Vec 包装器和 Index 实现的范围。完成标准是:在不改变行为的情况下,一致地替换已识别出的手动索引转换。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- rust
- 领域
- compilers
- Issue 类型
- 重构
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 42/100