Skip to content

Commit

Permalink
Fix issue with expandarray, add missing jl, enable tests (Shopify#409)
Browse files Browse the repository at this point in the history
  • Loading branch information
maximecb authored and pull[bot] committed Jan 13, 2024
1 parent 312ea93 commit 8138802
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 1 deletion.
3 changes: 3 additions & 0 deletions yjit/src/backend/arm64/mod.rs
Expand Up @@ -826,6 +826,9 @@ impl Assembler
Op::Jne => {
emit_conditional_jump::<{Condition::NE}>(cb, insn.target.unwrap());
},
Op::Jl => {
emit_conditional_jump::<{Condition::LT}>(cb, insn.target.unwrap());
},
Op::Jbe => {
emit_conditional_jump::<{Condition::LS}>(cb, insn.target.unwrap());
},
Expand Down
2 changes: 2 additions & 0 deletions yjit/src/backend/ir.rs
Expand Up @@ -118,6 +118,7 @@ pub enum Op
JmpOpnd,

// Low-level conditional jump instructions
Jl,
Jbe,
Je,
Jne,
Expand Down Expand Up @@ -988,6 +989,7 @@ def_push_1_opnd_no_out!(jmp_opnd, Op::JmpOpnd);
def_push_jcc!(jmp, Op::Jmp);
def_push_jcc!(je, Op::Je);
def_push_jcc!(jne, Op::Jne);
def_push_jcc!(jl, Op::Jl);
def_push_jcc!(jbe, Op::Jbe);
def_push_jcc!(jz, Op::Jz);
def_push_jcc!(jnz, Op::Jnz);
Expand Down
8 changes: 8 additions & 0 deletions yjit/src/backend/x86_64/mod.rs
Expand Up @@ -465,6 +465,14 @@ impl Assembler
}
}

Op::Jl => {
match insn.target.unwrap() {
Target::CodePtr(code_ptr) => jl_ptr(cb, code_ptr),
Target::Label(label_idx) => jl_label(cb, label_idx),
_ => unreachable!()
}
},

Op::Jbe => {
match insn.target.unwrap() {
Target::CodePtr(code_ptr) => jbe_ptr(cb, code_ptr),
Expand Down
2 changes: 1 addition & 1 deletion yjit/src/codegen.rs
Expand Up @@ -1445,7 +1445,7 @@ fn gen_expandarray(
// Only handle the case where the number of values in the array is greater
// than or equal to the number of values requested.
asm.cmp(array_len_opnd, num.into());
asm.jo(counted_exit!(ocb, side_exit, expandarray_rhs_too_small).into());
asm.jl(counted_exit!(ocb, side_exit, expandarray_rhs_too_small).into());

// Load the address of the embedded array into REG1.
// (struct RArray *)(obj)->as.ary
Expand Down

0 comments on commit 8138802

Please sign in to comment.