[前][次][番号順一覧][スレッド一覧]

ruby-changes:73166

From: Maxime <ko1@a...>
Date: Tue, 30 Aug 2022 00:57:44 +0900 (JST)
Subject: [ruby-changes:73166] 6e5382780f (master): Port over putstring

https://git.ruby-lang.org/ruby.git/commit/?id=6e5382780f

From 6e5382780f4c6cdb7eef945898448639071969fc Mon Sep 17 00:00:00 2001
From: Maxime Chevalier-Boisvert <maxime.chevalierboisvert@s...>
Date: Tue, 12 Jul 2022 15:28:54 -0400
Subject: Port over putstring

---
 yjit/src/codegen.rs | 17 +++++++++++------
 1 file 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( https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L1754
 
     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> { https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L6021
         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),
-- 
cgit v1.2.1


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]