Skip to content

Commit 51b2e4f

Browse files
committed
Move Insn::GetEP into block where it is used. This diminishes test diffs substantially.
1 parent 64f548c commit 51b2e4f

3 files changed

Lines changed: 166 additions & 200 deletions

File tree

zjit/src/hir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6752,11 +6752,11 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
67526752
YARVINSN_setlocal_WC_0 => {
67536753
let ep_offset = get_arg(pc, 0).as_u32();
67546754
const level: u32 = 0;
6755-
let ep = fun.push_insn(block, Insn::GetEP { level });
67566755
let val = state.stack_pop()?;
67576756
// In ZJIT, Insn::SetLocal only needs to be executed when ep is escaped
67586757
if ep_escaped || has_blockiseq { // TODO: figure out how to drop has_blockiseq here
67596758
// Write the local using EP
6759+
let ep = fun.push_insn(block, Insn::GetEP { level });
67606760
let exit_id = fun.push_insn(block, Insn::Snapshot { state: exit_state.without_locals() }); // skip spilling locals
67616761
let flags = fun.push_insn(block, Insn::LoadField { recv: ep, id: ID!(_env_data_index_flags), offset: SIZEOF_VALUE_I32 * (VM_ENV_DATA_INDEX_FLAGS as i32), return_type: types::CInt64 });
67626762
fun.push_insn(block, Insn::GuardNoBitsSet { val: flags, mask: Const::CUInt64(VM_ENV_FLAG_WB_REQUIRED.into()), reason: SideExitReason::WriteBarrierRequired, state: exit_id });

0 commit comments

Comments
 (0)