1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//! Implementation of the interpreter loop for Pulley with a simple `match`
//! statement.
//!
//! This module is notably in contrast to the `tail_loop.rs` which implements
//! the interpreter loop with tail calls. It's predicted that tail calls are a
//! more performant solution but that's also not available on stable Rust today,
//! so this module instead compiles on stable Rust.
//!
//! This interpreter loop is a simple `loop` with a "moral `match`" despite not
//! actually having one here. The `Decoder` API is used to dispatch to the
//! `OpVisitor` trait implementation on `Interpreter<'_>`. The literal `match`
//! is embedded within the `Decoder::decode_one` function.
//!
//! Note that as of the time of this writing there hasn't been much performance
//! analysis of this loop just yet. It's probably too simple to compile well and
//! will probably need tweaks to make it more performant.
use *;