Skip to content

Commit ff5f284

Browse files
committed
Move Insn::GetEP into block where it is used. This diminishes test diffs substantially.
1 parent b66aabb commit ff5f284

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
@@ -6786,11 +6786,11 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
67866786
YARVINSN_setlocal_WC_0 => {
67876787
let ep_offset = get_arg(pc, 0).as_u32();
67886788
const level: u32 = 0;
6789-
let ep = fun.push_insn(block, Insn::GetEP { level });
67906789
let val = state.stack_pop()?;
67916790
// In ZJIT, Insn::SetLocal only needs to be executed when ep is escaped
67926791
if ep_escaped || has_blockiseq { // TODO: figure out how to drop has_blockiseq here
67936792
// Write the local using EP
6793+
let ep = fun.push_insn(block, Insn::GetEP { level });
67946794
let exit_id = fun.push_insn(block, Insn::Snapshot { state: exit_state.without_locals() }); // skip spilling locals
67956795
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 });
67966796
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)