From 6ba07df4908d4d9d01ece339219e3b9e07ad1bce Mon Sep 17 00:00:00 2001 From: Maxime Chevalier-Boisvert Date: Fri, 17 Mar 2023 16:16:34 -0400 Subject: [PATCH] YJIT: make type info more specific in gen_fixnum_cmp and gen_opt_mod (#7555) --- yjit/src/codegen.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs index 855182b341..e8cd256b4f 100644 --- a/yjit/src/codegen.rs +++ b/yjit/src/codegen.rs @@ -2673,7 +2673,7 @@ fn gen_fixnum_cmp( let bool_opnd = cmov_op(asm, Qtrue.into(), Qfalse.into()); // Push the output on the stack - let dst = ctx.stack_push(Type::Unknown); + let dst = ctx.stack_push(Type::UnknownImm); asm.mov(dst, bool_opnd); KeepCompiling @@ -3297,7 +3297,8 @@ fn gen_opt_mod( let ret = asm.ccall(rb_fix_mod_fix as *const u8, vec![arg0, arg1]); // Push the return value onto the stack - let stack_ret = ctx.stack_push(Type::Unknown); + // When the two arguments are fixnums, the modulo output is always a fixnum + let stack_ret = ctx.stack_push(Type::Fixnum); asm.mov(stack_ret, ret); KeepCompiling @@ -5910,7 +5911,6 @@ fn gen_send_iseq( argc = lead_num; } - if iseq_has_rest { // We are going to allocate so setting pc and sp.