aboutsummaryrefslogtreecommitdiffstats
path: root/yjit/src/codegen.rs
diff options
context:
space:
mode:
authorMaxime Chevalier-Boisvert <maxime.chevalierboisvert@shopify.com>2022-07-12 15:28:54 -0400
committerTakashi Kokubun <takashikkbn@gmail.com>2022-08-29 08:47:00 -0700
commit6e5382780f4c6cdb7eef945898448639071969fc (patch)
treea80c77011ee815619206b964e4f345cb049ce136 /yjit/src/codegen.rs
parent86606e01ee984cd9aebdcc68c0b5025604fb5184 (diff)
downloadruby-6e5382780f4c6cdb7eef945898448639071969fc.tar.gz
Port over putstring
Diffstat (limited to 'yjit/src/codegen.rs')
-rw-r--r--yjit/src/codegen.rs17
1 files changed, 11 insertions, 6 deletions
diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs
index 1b05dc36c6..a54137fa97 100644
--- a/yjit/src/codegen.rs
+++ b/yjit/src/codegen.rs
@@ -1754,28 +1754,31 @@ fn gen_newhash(
KeepCompiling
}
+*/
fn gen_putstring(
jit: &mut JITState,
ctx: &mut Context,
- cb: &mut CodeBlock,
+ asm: &mut Assembler,
_ocb: &mut OutlinedCb,
) -> CodegenStatus {
let put_val = jit_get_arg(jit, 0);
// Save the PC and SP because the callee will allocate
- jit_prepare_routine_call(jit, ctx, cb, REG0);
+ jit_prepare_routine_call(jit, ctx, asm);
- mov(cb, C_ARG_REGS[0], REG_EC);
- jit_mov_gc_ptr(jit, cb, C_ARG_REGS[1], put_val);
- call_ptr(cb, REG0, rb_ec_str_resurrect as *const u8);
+ let str_opnd = asm.ccall(
+ rb_ec_str_resurrect as *const u8,
+ vec![EC, put_val.into()]
+ );
let stack_top = ctx.stack_push(Type::CString);
- mov(cb, stack_top, RAX);
+ asm.mov(stack_top, str_opnd);
KeepCompiling
}
+/*
// Push Qtrue or Qfalse depending on whether the given keyword was supplied by
// the caller
fn gen_checkkeyword(
@@ -6018,7 +6021,9 @@ fn get_gen_fn(opcode: VALUE) -> Option<InsnGenFn> {
YARVINSN_opt_str_uminus => Some(gen_opt_str_uminus),
YARVINSN_splatarray => Some(gen_splatarray),
YARVINSN_newrange => Some(gen_newrange),
+ */
YARVINSN_putstring => Some(gen_putstring),
+ /*
YARVINSN_expandarray => Some(gen_expandarray),
YARVINSN_defined => Some(gen_defined),
YARVINSN_checkkeyword => Some(gen_checkkeyword),