Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Fix more jit
  • Loading branch information
ShaharNaveh committed Mar 2, 2026
commit 8af88fe9ed86dc454d1a325c6bda846bf0649eaa
18 changes: 9 additions & 9 deletions crates/jit/src/instructions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -634,14 +634,14 @@ impl<'a, 'b> FunctionCompiler<'a, 'b> {
self.stack.push(val);
Ok(())
}
Instruction::LoadSmallInt { idx } => {
let small_int = idx.get(arg) as i64;
Instruction::LoadSmallInt { i } => {
let small_int = i.get(arg) as i64;
let val = self.builder.ins().iconst(types::I64, small_int);
self.stack.push(JitValue::Int(val));
Ok(())
}
Instruction::LoadFast { namei } | Instruction::LoadFastBorrow { namei } => {
let local = self.variables[namei.get(arg) as usize]
Instruction::LoadFast { var_num } | Instruction::LoadFastBorrow { var_num } => {
let local = self.variables[var_num.get(arg) as usize]
.as_ref()
.ok_or(JitCompileError::BadBytecode)?;
self.stack.push(JitValue::from_type_and_value(
Expand All @@ -650,9 +650,9 @@ impl<'a, 'b> FunctionCompiler<'a, 'b> {
));
Ok(())
}
Instruction::LoadFastLoadFast { var_num }
| Instruction::LoadFastBorrowLoadFastBorrow { var_nums: var_num } => {
let oparg = var_num.get(arg);
Instruction::LoadFastLoadFast { var_nums }
| Instruction::LoadFastBorrowLoadFastBorrow { var_nums } => {
let oparg = var_nums.get(arg);
let idx1 = oparg >> 4;
let idx2 = oparg & 0xF;
for idx in [idx1, idx2] {
Expand Down Expand Up @@ -723,9 +723,9 @@ impl<'a, 'b> FunctionCompiler<'a, 'b> {
let val = self.stack.pop().ok_or(JitCompileError::BadBytecode)?;
self.return_value(val)
}
Instruction::StoreFast { namei } => {
Instruction::StoreFast { var_num } => {
let val = self.stack.pop().ok_or(JitCompileError::BadBytecode)?;
self.store_variable(namei.get(arg), val)
self.store_variable(var_num.get(arg), val)
}
Instruction::Swap { i: index } => {
let len = self.stack.len();
Expand Down
Loading