summaryrefslogtreecommitdiff
path: root/yjit
diff options
context:
space:
mode:
authorMaxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>2023-03-17 16:16:34 -0400
committerGitHub <noreply@github.com>2023-03-17 16:16:34 -0400
commit6ba07df4908d4d9d01ece339219e3b9e07ad1bce (patch)
treed6eb903913b0fb538908beb95105f03ea10fae44 /yjit
parent7fc796f92af6ddb26df8f1258d3a864a8c6e388d (diff)
YJIT: make type info more specific in gen_fixnum_cmp and gen_opt_mod (#7555)
Notes
Notes: Merged-By: maximecb <maximecb@ruby-lang.org>
Diffstat (limited to 'yjit')
-rw-r--r--yjit/src/codegen.rs6
1 files 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.