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

ruby-changes:73252

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

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

From db22a560a49b4ad82430b6bec7feaf2a4a3bfe19 Mon Sep 17 00:00:00 2001
From: Zack Deveau <zack.ref@g...>
Date: Fri, 5 Aug 2022 09:18:34 -0400
Subject: Port gen_opt_str_freeze to new backend IR
 (https://github.com/Shopify/ruby/pull/366)

---
 yjit/src/codegen.rs | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/yjit/src/codegen.rs b/yjit/src/codegen.rs
index 58bc036756..87bb43caa2 100644
--- a/yjit/src/codegen.rs
+++ b/yjit/src/codegen.rs
@@ -3054,11 +3054,11 @@ fn gen_opt_succ( https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L3054
     gen_opt_send_without_block(jit, ctx, asm, ocb)
 }
 
-/*
+
 fn gen_opt_str_freeze(
     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_FREEZE) {
@@ -3066,15 +3066,15 @@ fn gen_opt_str_freeze( https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L3066
     }
 
     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_str_uminus(
     jit: &mut JITState,
     ctx: &mut Context,
@@ -5964,7 +5964,7 @@ fn get_gen_fn(opcode: VALUE) -> Option<InsnGenFn> { https://github.com/ruby/ruby/blob/trunk/yjit/src/codegen.rs#L5964
         YARVINSN_opt_gt => Some(gen_opt_gt),
         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_freeze => Some(gen_opt_str_freeze),
         //YARVINSN_opt_str_uminus => Some(gen_opt_str_uminus),
         YARVINSN_splatarray => Some(gen_splatarray),
         YARVINSN_newrange => Some(gen_newrange),
-- 
cgit v1.2.1


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

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