mirror of
https://github.com/aljazceru/turso.git
synced 2026-01-04 00:44:19 +01:00
Merge 'Implement Noop bytecode' from Pedro Muniz
This PR implements Noop. I really don't know what else to say. This bytecode according to sqlite does: _Do nothing. Continue downward to the next opcode._ I advanced the program counter to account for continuing to the next instruction. Closes #795
This commit is contained in:
@@ -487,7 +487,7 @@ Modifiers:
|
||||
| Next | No | |
|
||||
| NextAsync | Yes | |
|
||||
| NextAwait | Yes | |
|
||||
| Noop | No | |
|
||||
| Noop | Yes | |
|
||||
| Not | Yes | |
|
||||
| NotExists | Yes | |
|
||||
| NotFound | No | |
|
||||
|
||||
@@ -1154,6 +1154,15 @@ pub fn insn_to_str(
|
||||
0,
|
||||
format!("r[{}]=(r[{}] || r[{}])", dest, lhs, rhs),
|
||||
),
|
||||
Insn::Noop => (
|
||||
"Noop",
|
||||
0,
|
||||
0,
|
||||
0,
|
||||
OwnedValue::build_text(Rc::new("".to_string())),
|
||||
0,
|
||||
String::new(),
|
||||
),
|
||||
};
|
||||
format!(
|
||||
"{:<4} {:<17} {:<4} {:<4} {:<4} {:<13} {:<2} {}",
|
||||
|
||||
@@ -569,6 +569,7 @@ pub enum Insn {
|
||||
rhs: usize,
|
||||
dest: usize,
|
||||
},
|
||||
Noop,
|
||||
}
|
||||
|
||||
fn cast_text_to_numerical(value: &str) -> OwnedValue {
|
||||
|
||||
@@ -2457,6 +2457,11 @@ impl Program {
|
||||
exec_or(&state.registers[*lhs], &state.registers[*rhs]);
|
||||
state.pc += 1;
|
||||
}
|
||||
Insn::Noop => {
|
||||
// Do nothing
|
||||
// Advance the program counter for the next opcode
|
||||
state.pc += 1
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user