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

ruby-changes:69279

From: John <ko1@a...>
Date: Thu, 21 Oct 2021 08:21:42 +0900 (JST)
Subject: [ruby-changes:69279] 6db5e80dd7 (master): Use method dispatch for opt_eq

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

From 6db5e80dd7e91fcfaf55727dbe24619d964cfac4 Mon Sep 17 00:00:00 2001
From: John Hawthorn <john@h...>
Date: Thu, 12 Aug 2021 12:02:43 -0700
Subject: Use method dispatch for opt_eq

---
 yjit_codegen.c | 26 +++-----------------------
 1 file changed, 3 insertions(+), 23 deletions(-)

diff --git a/yjit_codegen.c b/yjit_codegen.c
index 5ac4e0d9d1..22901ab2ab 100644
--- a/yjit_codegen.c
+++ b/yjit_codegen.c
@@ -2126,34 +2126,14 @@ gen_opt_gt(jitstate_t* jit, ctx_t* ctx) https://github.com/ruby/ruby/blob/trunk/yjit_codegen.c#L2126
 
 VALUE rb_opt_equality_specialized(VALUE recv, VALUE obj);
 
+static codegen_status_t gen_opt_send_without_block(jitstate_t *jit, ctx_t *ctx);
+
 static codegen_status_t
 gen_opt_eq(jitstate_t* jit, ctx_t* ctx)
 {
-    uint8_t* side_exit = yjit_side_exit(jit, ctx);
-
-    // Get the operands from the stack
-    x86opnd_t arg1 = ctx_stack_pop(ctx, 1);
-    x86opnd_t arg0 = ctx_stack_pop(ctx, 1);
-
-    // Call rb_opt_equality_specialized(VALUE recv, VALUE obj)
-    // We know this method won't allocate or perform calls
-    mov(cb, C_ARG_REGS[0], arg0);
-    mov(cb, C_ARG_REGS[1], arg1);
-    call_ptr(cb, REG0, (void *)rb_opt_equality_specialized);
-
-    // If val == Qundef, bail to do a method call
-    cmp(cb, RAX, imm_opnd(Qundef));
-    je_ptr(cb, side_exit);
-
-    // Push the return value onto the stack
-    x86opnd_t stack_ret = ctx_stack_push(ctx, TYPE_IMM);
-    mov(cb, stack_ret, RAX);
-
-    return YJIT_KEEP_COMPILING;
+	return gen_opt_send_without_block(jit, ctx);
 }
 
-static codegen_status_t gen_opt_send_without_block(jitstate_t *jit, ctx_t *ctx);
-
 static codegen_status_t gen_send_general(jitstate_t *jit, ctx_t *ctx, struct rb_call_data *cd, rb_iseq_t *block);
 
 static codegen_status_t
-- 
cgit v1.2.1


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

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