remove Jump/Label from mono::Expr

This commit is contained in:
Folkert 2020-03-24 00:11:02 +01:00
parent 958f3f9ad4
commit 39fb78b2d5
3 changed files with 10 additions and 9 deletions

View file

@ -1075,10 +1075,15 @@ fn decide_to_branching<'a>(
use Choice::*;
use Decider::*;
let jump_count = *env.jump_counter;
match decider {
Leaf(Jump(label)) => (&[], Expr::Jump(label + jump_count)),
Leaf(Jump(label)) => {
// we currently inline the jumps: does fewer jumps but produces a larger artifact
let (_, stores, expr) = jumps
.iter()
.find(|(l, _, _)| l == &label)
.expect("jump not in list of jumps");
(stores, expr.clone())
}
Leaf(Inline(stores, expr)) => (stores, expr),
Chain {
test_chain,

View file

@ -201,9 +201,6 @@ pub enum Expr<'a> {
elems: &'a [Expr<'a>],
},
Label(u64, &'a Expr<'a>),
Jump(u64),
RuntimeError(&'a str),
}