Skip to content

Commit 50e78d3

Browse files
committed
use set_snapshot_spilled_locals
1 parent 921f321 commit 50e78d3

1 file changed

Lines changed: 6 additions & 10 deletions

File tree

zjit/src/hir.rs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10461,11 +10461,9 @@ fn add_iseq_to_hir(
1046110461

1046210462
// Primitive.cexpr! and friends have access to all Ruby locals as C locals,
1046310463
// so we spill all locals here.
10464-
let Insn::Snapshot { state: entry_state } = &mut fun.insns[exit_id] else {
10465-
unreachable!("exit_id always points to a snapshot");
10466-
};
10467-
entry_state.spilled_locals = LocalSet::with_capacity(entry_state.locals.len());
10468-
entry_state.spilled_locals.insert_all();
10464+
let mut all_spilled = LocalSet::with_capacity(exit_state.locals.len());
10465+
all_spilled.insert_all();
10466+
fun.set_snapshot_spilled_locals(exit_id, all_spilled);
1046910467

1047010468
let insn_id = fun.try_inline_invoke_builtin(block, Insn::InvokeBuiltin {
1047110469
bf,
@@ -10497,11 +10495,9 @@ fn add_iseq_to_hir(
1049710495

1049810496
// Primitive.cexpr! and friends have access to all Ruby locals as C locals,
1049910497
// so we spill all locals here.
10500-
let Insn::Snapshot { state: entry_state } = &mut fun.insns[exit_id] else {
10501-
unreachable!("exit_id always points to a snapshot");
10502-
};
10503-
entry_state.spilled_locals = LocalSet::with_capacity(entry_state.locals.len());
10504-
entry_state.spilled_locals.insert_all();
10498+
let mut all_spilled = LocalSet::with_capacity(exit_state.locals.len());
10499+
all_spilled.insert_all();
10500+
fun.set_snapshot_spilled_locals(exit_id, all_spilled);
1050510501

1050610502
let insn_id = fun.try_inline_invoke_builtin(block, Insn::InvokeBuiltin {
1050710503
bf,

0 commit comments

Comments
 (0)