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,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(())
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue