summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Lo <stan.lo@shopify.com>2025-09-09 22:41:09 +0100
committerTakashi Kokubun <takashikkbn@gmail.com>2025-09-10 10:26:09 -0700
commit877b625922e0f8de4e7ad801dd0306e69b34d263 (patch)
tree5589c599f97ae735a5de53a95907c5971fafe819
parent33cd97006d740211e915ca85a42ffcb55e76919c (diff)
ZJIT: Removed unused self_val from InvokeSuper
-rw-r--r--zjit/src/hir.rs23
1 files changed, 11 insertions, 12 deletions
diff --git a/zjit/src/hir.rs b/zjit/src/hir.rs
index ca31c7d338..b5fe0895da 100644
--- a/zjit/src/hir.rs
+++ b/zjit/src/hir.rs
@@ -584,7 +584,7 @@ pub enum Insn {
/// Ignoring keyword arguments etc for now
SendWithoutBlock { self_val: InsnId, cd: *const rb_call_data, args: Vec<InsnId>, state: InsnId },
Send { self_val: InsnId, cd: *const rb_call_data, blockiseq: IseqPtr, args: Vec<InsnId>, state: InsnId },
- InvokeSuper { self_val: InsnId, cd: *const rb_call_data, blockiseq: IseqPtr, args: Vec<InsnId>, state: InsnId },
+ InvokeSuper { cd: *const rb_call_data, blockiseq: IseqPtr, args: Vec<InsnId>, state: InsnId },
InvokeBlock { cd: *const rb_call_data, args: Vec<InsnId>, state: InsnId },
/// Optimized ISEQ call
@@ -839,8 +839,8 @@ impl<'a> std::fmt::Display for InsnPrinter<'a> {
}
Ok(())
}
- Insn::InvokeSuper { self_val, blockiseq, args, .. } => {
- write!(f, "InvokeSuper {self_val}, {:p}", self.ptr_map.map_ptr(blockiseq))?;
+ Insn::InvokeSuper { blockiseq, args, .. } => {
+ write!(f, "InvokeSuper {:p}", self.ptr_map.map_ptr(blockiseq))?;
for arg in args {
write!(f, ", {arg}")?;
}
@@ -1350,8 +1350,7 @@ impl Function {
args: find_vec!(args),
state,
},
- &InvokeSuper { self_val, cd, blockiseq, ref args, state } => InvokeSuper {
- self_val: find!(self_val),
+ &InvokeSuper { cd, blockiseq, ref args, state } => InvokeSuper {
cd,
blockiseq,
args: find_vec!(args),
@@ -2284,13 +2283,13 @@ impl Function {
}
&Insn::Send { self_val, ref args, state, .. }
| &Insn::SendWithoutBlock { self_val, ref args, state, .. }
- | &Insn::SendWithoutBlockDirect { self_val, ref args, state, .. }
- | &Insn::InvokeSuper { self_val, ref args, state, .. } => {
+ | &Insn::SendWithoutBlockDirect { self_val, ref args, state, .. } => {
worklist.push_back(self_val);
worklist.extend(args);
worklist.push_back(state);
}
- &Insn::InvokeBuiltin { ref args, state, .. }
+ &Insn::InvokeSuper { ref args, state, .. }
+ | &Insn::InvokeBuiltin { ref args, state, .. }
| &Insn::InvokeBlock { ref args, state, .. } => {
worklist.extend(args);
worklist.push_back(state)
@@ -3649,10 +3648,10 @@ pub fn iseq_to_hir(iseq: *const rb_iseq_t) -> Result<Function, ParseError> {
}
let argc = unsafe { vm_ci_argc((*cd).ci) };
let args = state.stack_pop_n(argc as usize)?;
- let recv = state.stack_pop()?;
+ let _recv = state.stack_pop()?;
let blockiseq: IseqPtr = get_arg(pc, 1).as_ptr();
let exit_id = fun.push_insn(block, Insn::Snapshot { state: exit_state });
- let result = fun.push_insn(block, Insn::InvokeSuper { self_val: recv, cd, blockiseq, args, state: exit_id });
+ let result = fun.push_insn(block, Insn::InvokeSuper { cd, blockiseq, args, state: exit_id });
state.stack_push(result);
if !blockiseq.is_null() {
@@ -5176,7 +5175,7 @@ mod tests {
assert_snapshot!(hir_string("test"), @r"
fn test@<compiled>:2:
bb0(v0:BasicObject):
- v5:BasicObject = InvokeSuper v0, 0x1000
+ v5:BasicObject = InvokeSuper 0x1000
CheckInterrupts
Return v5
");
@@ -5190,7 +5189,7 @@ mod tests {
assert_snapshot!(hir_string("test"), @r"
fn test@<compiled>:2:
bb0(v0:BasicObject):
- v5:BasicObject = InvokeSuper v0, 0x1000
+ v5:BasicObject = InvokeSuper 0x1000
CheckInterrupts
Return v5
");