Repository navigation
Commit 4d23e21
committed
ZJIT: Avoid copying frame states in stack maps
build_stack_map only reads FrameState. It cloned the input state and cloned each caller state through Function::frame_state.
Function::frame_state calls Function::find. Function::find clones the Snapshot and resolves its stack and local InsnId values. The input state clone does not resolve IDs.
Borrow the stored states instead. Resolve each stack InsnId with Function::find_id before JITState::get_opnd.
This avoids FrameState allocation and copies of its stack and locals vectors during stack-map construction. The generated stack map is unchanged.1 parent 0bdfb4c commit 4d23e21
1 file changed
Lines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3503 | 3503 | | |
3504 | 3504 | | |
3505 | 3505 | | |
3506 | | - | |
| 3506 | + | |
3507 | 3507 | | |
3508 | 3508 | | |
3509 | | - | |
| 3509 | + | |
3510 | 3510 | | |
3511 | 3511 | | |
3512 | 3512 | | |
| |||
3518 | 3518 | | |
3519 | 3519 | | |
3520 | 3520 | | |
3521 | | - | |
| 3521 | + | |
3522 | 3522 | | |
3523 | 3523 | | |
3524 | 3524 | | |
| |||
0 commit comments