summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAiden Fox Ivey <aiden@aidenfoxivey.com>2025-10-24 10:30:31 -0400
committerTakashi Kokubun <takashikkbn@gmail.com>2025-10-27 12:56:41 -0700
commita12aa2b5aa0598ccf5bb9ff0f9b5dfde8a873be5 (patch)
treec6b72bbb94b6a23d6b26f036bfefab1db3a6e5f1
parentac57a5c43ea6b12350eb7efbee50d6682021dc6c (diff)
ZJIT: Since Param is unit struct, elide destructuring
-rw-r--r--zjit/src/hir.rs12
1 files changed, 6 insertions, 6 deletions
diff --git a/zjit/src/hir.rs b/zjit/src/hir.rs
index 4eba78b752..61014d5fd4 100644
--- a/zjit/src/hir.rs
+++ b/zjit/src/hir.rs
@@ -841,7 +841,7 @@ impl Insn {
fn has_effects(&self) -> bool {
match self {
Insn::Const { .. } => false,
- Insn::Param { .. } => false,
+ Insn::Param => false,
Insn::StringCopy { .. } => false,
Insn::NewArray { .. } => false,
// NewHash's operands may be hashed and compared for equality, which could have
@@ -1469,7 +1469,7 @@ impl Function {
// Add an instruction to an SSA block
pub fn push_insn(&mut self, block: BlockId, insn: Insn) -> InsnId {
- let is_param = matches!(insn, Insn::Param { .. });
+ let is_param = matches!(insn, Insn::Param);
let id = self.new_insn(insn);
if is_param {
self.blocks[block.0].params.push(id);
@@ -1576,7 +1576,7 @@ impl Function {
use Insn::*;
match &self.insns[insn_id.0] {
result@(Const {..}
- | Param {..}
+ | Param
| GetConstantPath {..}
| IsBlockGiven
| PatchPoint {..}
@@ -1771,7 +1771,7 @@ impl Function {
fn infer_type(&self, insn: InsnId) -> Type {
assert!(self.insns[insn.0].has_output());
match &self.insns[insn.0] {
- Insn::Param { .. } => unimplemented!("params should not be present in block.insns"),
+ Insn::Param => unimplemented!("params should not be present in block.insns"),
Insn::SetGlobal { .. } | Insn::Jump(_) | Insn::EntryPoint { .. }
| Insn::IfTrue { .. } | Insn::IfFalse { .. } | Insn::Return { .. } | Insn::Throw { .. }
| Insn::PatchPoint { .. } | Insn::SetIvar { .. } | Insn::SetClassVar { .. } | Insn::ArrayExtend { .. }
@@ -1847,7 +1847,7 @@ impl Function {
Insn::Defined { pushval, .. } => Type::from_value(*pushval).union(types::NilClass),
Insn::DefinedIvar { pushval, .. } => Type::from_value(*pushval).union(types::NilClass),
Insn::GetConstantPath { .. } => types::BasicObject,
- Insn::IsBlockGiven { .. } => types::BoolExact,
+ Insn::IsBlockGiven => types::BoolExact,
Insn::ArrayMax { .. } => types::BasicObject,
Insn::GetGlobal { .. } => types::BasicObject,
Insn::GetIvar { .. } => types::BasicObject,
@@ -3024,7 +3024,7 @@ impl Function {
fn worklist_traverse_single_insn(&self, insn: &Insn, worklist: &mut VecDeque<InsnId>) {
match insn {
&Insn::Const { .. }
- | &Insn::Param { .. }
+ | &Insn::Param
| &Insn::EntryPoint { .. }
| &Insn::LoadPC
| &Insn::LoadSelf