Skip to content

Commit 8f18d59

Browse files
committed
impl for pseudo
1 parent f6c9b1c commit 8f18d59

1 file changed

Lines changed: 18 additions & 0 deletions

File tree

crates/compiler-core/src/bytecode/instruction.rs

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1731,6 +1731,22 @@ impl InstructionMetadata for PseudoInstruction {
17311731
matches!(self, Self::Jump { .. } | Self::JumpNoInterrupt { .. })
17321732
}
17331733

1734+
fn name(&self) -> &str {
1735+
match self {
1736+
Self::AnnotationsPlaceholder => "ANNOTATIONS_PLACEHOLDER",
1737+
Self::Jump { .. } => "JUMP",
1738+
Self::JumpIfFalse { .. } => "JUMP_IF_FALSE",
1739+
Self::JumpIfTrue { .. } => "JUMP_IF_TRUE",
1740+
Self::JumpNoInterrupt { .. } => "JUMP_NO_INTERRUPT",
1741+
Self::LoadClosure { .. } => "LOAD_CLOSURE",
1742+
Self::PopBlock => "POP_BLOCK",
1743+
Self::SetupCleanup { .. } => "SETUP_CLEANUP",
1744+
Self::SetupFinally { .. } => "SETUP_FINALLY",
1745+
Self::SetupWith { .. } => "SETUP_WITH",
1746+
Self::StoreFastMaybeNull { .. } => "STORE_FAST_MAYBE_NULL",
1747+
}
1748+
}
1749+
17341750
fn fmt_dis(
17351751
&self,
17361752
_arg: OpArg,
@@ -1803,6 +1819,8 @@ impl InstructionMetadata for AnyInstruction {
18031819

18041820
inst_either!(fn stack_effect_info(&self, oparg: u32) -> StackEffect);
18051821

1822+
inst_either!(fn name(&self) -> &str);
1823+
18061824
inst_either!(fn fmt_dis(
18071825
&self,
18081826
arg: OpArg,

0 commit comments

Comments
 (0)