Skip to content

Commit b003f2f

Browse files
committed
post ep escape, reload everything
1 parent b3b9271 commit b003f2f

1 file changed

Lines changed: 8 additions & 3 deletions

File tree

zjit/src/hir.rs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5094,11 +5094,16 @@ impl Function {
50945094
state: &mut FrameState,
50955095
ep_escaped: bool,
50965096
) {
5097-
let to_reload = (0..state.locals.len())
5098-
.filter(|&local_idx| {
5097+
let to_reload: &mut dyn Iterator<Item = usize> = if ep_escaped {
5098+
// Reload everything when working with an escaped environment
5099+
&mut (0..state.locals.len())
5100+
} else {
5101+
// When not escaped, only reload the ones syntactically written to
5102+
&mut (0..state.locals.len()).filter(|&local_idx| {
50995103
let id = unsafe { rb_zjit_local_id(iseq, local_idx.try_into().unwrap()) };
51005104
unsafe { rb_zjit_iseq_writes_outer_local_p(blockiseq, id) }
5101-
});
5105+
})
5106+
};
51025107
let mut base: Option<InsnId> = None;
51035108
for local_idx in to_reload {
51045109
let ep_offset = local_idx_to_ep_offset(iseq, local_idx);

0 commit comments

Comments
 (0)