Skip to content

Commit deceb76

Browse files
committed
Remove unnecessary const generic in interpreter
1 parent dbf8493 commit deceb76

File tree

1 file changed

+7
-15
lines changed

1 file changed

+7
-15
lines changed

crates/polkavm/src/interpreter.rs

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -554,22 +554,14 @@ impl InterpretedInstance {
554554
|| log::log_enabled!(target: "polkavm::interpreter", log::Level::Debug)
555555
|| cfg!(test)
556556
{
557-
if !self.step_tracing {
558-
Ok(self.run_impl::<true, false>())
559-
} else {
560-
Ok(self.run_impl::<true, true>())
561-
}
557+
Ok(self.run_impl::<true>())
562558
} else {
563-
if !self.step_tracing {
564-
Ok(self.run_impl::<false, false>())
565-
} else {
566-
Ok(self.run_impl::<false, true>())
567-
}
559+
Ok(self.run_impl::<false>())
568560
}
569561
}
570562

571563
#[inline(never)]
572-
fn run_impl<const DEBUG: bool, const STEP_TRACING: bool>(&mut self) -> InterruptKind {
564+
fn run_impl<const DEBUG: bool>(&mut self) -> InterruptKind {
573565
if !self.module.is_dynamic_paging() {
574566
self.basic_memory.mark_dirty();
575567
}
@@ -756,7 +748,7 @@ impl InterpretedInstance {
756748
#[cfg(debug_assertions)]
757749
let original_length = self.compiled_handlers.len();
758750

759-
instruction.visit(&mut Compiler::<DEBUG, false> {
751+
instruction.visit(&mut Compiler::<DEBUG> {
760752
program_counter: instruction.offset,
761753
next_program_counter: instruction.next_offset,
762754
compiled_handlers: &mut self.compiled_handlers,
@@ -2729,21 +2721,21 @@ define_interpreter! {
27292721
}
27302722
}
27312723

2732-
struct Compiler<'a, const DEBUG: bool, const STEP_TRACING: bool> {
2724+
struct Compiler<'a, const DEBUG: bool> {
27332725
program_counter: ProgramCounter,
27342726
next_program_counter: ProgramCounter,
27352727
compiled_handlers: &'a mut Vec<Handler>,
27362728
compiled_args: &'a mut Vec<Args>,
27372729
module: &'a Module,
27382730
}
27392731

2740-
impl<'a, const DEBUG: bool, const STEP_TRACING: bool> Compiler<'a, DEBUG, STEP_TRACING> {
2732+
impl<'a, const DEBUG: bool> Compiler<'a, DEBUG> {
27412733
fn next_program_counter(&self) -> ProgramCounter {
27422734
self.next_program_counter
27432735
}
27442736
}
27452737

2746-
impl<'a, const DEBUG: bool, const STEP_TRACING: bool> InstructionVisitor for Compiler<'a, DEBUG, STEP_TRACING> {
2738+
impl<'a, const DEBUG: bool> InstructionVisitor for Compiler<'a, DEBUG> {
27472739
type ReturnTy = ();
27482740

27492741
#[cold]

0 commit comments

Comments
 (0)