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

ruby-changes:73270

From: Zack <ko1@a...>
Date: Tue, 30 Aug 2022 01:05:55 +0900 (JST)
Subject: [ruby-changes:73270] e06c86fada (master): Port opt_str_uminus to new backend IR (https://github.com/Shopify/ruby/pull/370)

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

From e06c86fada92cf81cdc8e5cf4f0792ae701eb2e0 Mon Sep 17 00:00:00 2001
From: Zack Deveau <zack.ref@g...>
Date: Fri, 5 Aug 2022 13:32:16 -0400
Subject: Port  opt_str_uminus to new backend IR
 (https://github.com/Shopify/ruby/pull/370)

---
 yjit/src/codegen.rs | 9 +++------
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs
index 87bb43caa2..8b724a1fc9 100644
--- a/yjit/src/codegen.rs
+++ b/yjit/src/codegen.rs
@@ -3074,11 +3074,10 @@ fn gen_opt_str_freeze( https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L3074
     KeepCompiling
 }
 
-/*
 fn gen_opt_str_uminus(
     jit: &mut JITState,
     ctx: &mut Context,
-    cb: &mut CodeBlock,
+    asm: &mut Assembler,
     ocb: &mut OutlinedCb,
 ) -> CodegenStatus {
     if !assume_bop_not_redefined(jit, ocb, STRING_REDEFINED_OP_FLAG, BOP_UMINUS) {
@@ -3086,15 +3085,13 @@ fn gen_opt_str_uminus( https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L3085
     }
 
     let str = jit_get_arg(jit, 0);
-    jit_mov_gc_ptr(jit, cb, REG0, str);
 
     // Push the return value onto the stack
     let stack_ret = ctx.stack_push(Type::CString);
-    mov(cb, stack_ret, REG0);
+    asm.mov(stack_ret, str.into());
 
     KeepCompiling
 }
-*/
 
 fn gen_opt_not(
     jit: &mut JITState,
@@ -5965,7 +5962,7 @@ fn get_gen_fn(opcode: VALUE) -> Option<InsnGenFn> { https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L5962
         YARVINSN_opt_ge => Some(gen_opt_ge),
         YARVINSN_opt_mod => Some(gen_opt_mod),
         YARVINSN_opt_str_freeze => Some(gen_opt_str_freeze),
-        //YARVINSN_opt_str_uminus => Some(gen_opt_str_uminus),
+        YARVINSN_opt_str_uminus => Some(gen_opt_str_uminus),
         YARVINSN_splatarray => Some(gen_splatarray),
         YARVINSN_newrange => Some(gen_newrange),
         YARVINSN_putstring => Some(gen_putstring),
-- 
cgit v1.2.1


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

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