Collect a list of block arguments.
(
frame: &Frame,
args: impl Iterator<Item = BlockArg>,
)
| 45 | |
| 46 | /// Collect a list of block arguments. |
| 47 | fn collect_block_args( |
| 48 | frame: &Frame, |
| 49 | args: impl Iterator<Item = BlockArg>, |
| 50 | ) -> SmallVec<[DataValue; 1]> { |
| 51 | args.into_iter() |
| 52 | .map(|n| match n { |
| 53 | BlockArg::Value(n) => frame.get(n).clone(), |
| 54 | _ => panic!("exceptions not supported"), |
| 55 | }) |
| 56 | .collect() |
| 57 | } |
| 58 | |
| 59 | /// Interpret a single Cranelift instruction. Note that program traps and interpreter errors are |
| 60 | /// distinct: a program trap results in `Ok(Flow::Trap(...))` whereas an interpretation error (e.g. |