Commit 7722f20
ZJIT: Eliminate GuardType on frozen objects
When GuardType operates on a value that is a known frozen object (from a
constant), we can check at compile time if the object's type matches the
guard. Since frozen objects cannot change their class, the runtime guard
becomes unnecessary.
This optimization eliminates redundant type guards when accessing methods
on frozen constant objects, complementing the LoadField folding for ivar
reads.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>1 parent 4cd6661 commit 7722f20
1 file changed
Lines changed: 16 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3362 | 3362 | | |
3363 | 3363 | | |
3364 | 3364 | | |
3365 | | - | |
3366 | | - | |
3367 | | - | |
3368 | | - | |
| 3365 | + | |
| 3366 | + | |
| 3367 | + | |
| 3368 | + | |
| 3369 | + | |
| 3370 | + | |
| 3371 | + | |
| 3372 | + | |
| 3373 | + | |
| 3374 | + | |
| 3375 | + | |
| 3376 | + | |
| 3377 | + | |
| 3378 | + | |
| 3379 | + | |
| 3380 | + | |
3369 | 3381 | | |
3370 | 3382 | | |
3371 | 3383 | | |
| |||
0 commit comments