Basic block support in JIT

This commit is contained in:
Tom Schuster 2020-10-11 02:37:25 +02:00
parent eedbf3aa6c
commit 6d0978226e

View file

@ -1388,6 +1388,8 @@ impl<O: OutputStream> Compiler<O> {
self.emit(Instruction::CompareOperation {
op: to_operator(ops.last().unwrap()),
});
if vals.len() > 2 {
self.emit(Instruction::Jump { target: last_label });
// early exit left us with stack: `rhs, comparison_result`. We need to clean up rhs.
@ -1396,6 +1398,8 @@ impl<O: OutputStream> Compiler<O> {
self.emit(Instruction::Pop);
self.set_label(last_label);
}
Ok(())
}