Commit d9eea66
Remove redundant bound-method-field check in GlobalOpLowering (#250)
The #246 isBoundMethodTupleConstant special case in GlobalOpLowering
decided whether a global's initializer needs the constructor path based on
whether any ConstantOp in it had a bound-method-shaped tuple field. Since
PR #249 boxes every method-bearing object literal, such a literal's
initializer always contains a NewOp (the boxing recipe), which the walk's
existing NewOp case already forces onto the constructor path -- making the
bound-method check redundant. Verified via a diagnostic probe at that call
site across every test file (zero hits) before removing it for real.
Investigated but did NOT remove needsIdentityStorage/boundRefMaterializedCache:
contrary to the original plan (docs/object-literal-boxing-design.md), these
are still load-bearing. Whenever a boxed literal is unboxed back into a
plain tuple to match a declared/inferred type (annotated const, parameter,
interface-cast fallback, generic intersection/inference), the resulting
tuple's method field is still bound-method-shaped even though the tuple
itself is a plain value -- that machinery is what makes calling through it
work correctly instead of crash. Root-caused via site-tagged diagnostic
probes across the full test corpus; documented in the design doc so this
isn't re-attempted without re-deriving the same finding.
Full suite green: 353/353 JIT + 357/357 AOT.
Co-authored-by: Claude Sonnet 5 <noreply@anthropic.com>1 parent 9f0d1a6 commit d9eea66
2 files changed
Lines changed: 38 additions & 34 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
4 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
5 | 6 | | |
6 | 7 | | |
7 | 8 | | |
| |||
191 | 192 | | |
192 | 193 | | |
193 | 194 | | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
201 | 226 | | |
202 | 227 | | |
203 | 228 | | |
| |||
206 | 231 | | |
207 | 232 | | |
208 | 233 | | |
209 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
210 | 238 | | |
211 | 239 | | |
212 | 240 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3681 | 3681 | | |
3682 | 3682 | | |
3683 | 3683 | | |
3684 | | - | |
3685 | | - | |
3686 | | - | |
3687 | | - | |
3688 | | - | |
3689 | | - | |
3690 | | - | |
3691 | | - | |
3692 | | - | |
3693 | | - | |
3694 | | - | |
3695 | | - | |
3696 | | - | |
3697 | | - | |
3698 | | - | |
3699 | | - | |
3700 | | - | |
3701 | 3684 | | |
3702 | 3685 | | |
3703 | 3686 | | |
| |||
3722 | 3705 | | |
3723 | 3706 | | |
3724 | 3707 | | |
3725 | | - | |
3726 | | - | |
3727 | | - | |
3728 | | - | |
3729 | | - | |
3730 | | - | |
3731 | | - | |
3732 | 3708 | | |
3733 | 3709 | | |
3734 | 3710 | | |
| |||
0 commit comments