mirror of
https://github.com/RustPython/Parser.git
synced 2025-07-19 11:05:45 +00:00
Basic block support in JIT
This commit is contained in:
parent
eedbf3aa6c
commit
6d0978226e
1 changed files with 10 additions and 6 deletions
|
@ -1388,14 +1388,18 @@ impl<O: OutputStream> Compiler<O> {
|
||||||
self.emit(Instruction::CompareOperation {
|
self.emit(Instruction::CompareOperation {
|
||||||
op: to_operator(ops.last().unwrap()),
|
op: to_operator(ops.last().unwrap()),
|
||||||
});
|
});
|
||||||
self.emit(Instruction::Jump { target: last_label });
|
|
||||||
|
|
||||||
// early exit left us with stack: `rhs, comparison_result`. We need to clean up rhs.
|
if vals.len() > 2 {
|
||||||
self.set_label(break_label);
|
self.emit(Instruction::Jump { target: last_label });
|
||||||
self.emit(Instruction::Rotate { amount: 2 });
|
|
||||||
self.emit(Instruction::Pop);
|
// early exit left us with stack: `rhs, comparison_result`. We need to clean up rhs.
|
||||||
|
self.set_label(break_label);
|
||||||
|
self.emit(Instruction::Rotate { amount: 2 });
|
||||||
|
self.emit(Instruction::Pop);
|
||||||
|
|
||||||
|
self.set_label(last_label);
|
||||||
|
}
|
||||||
|
|
||||||
self.set_label(last_label);
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue