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

ruby-changes:69000

From: John <ko1@a...>
Date: Thu, 21 Oct 2021 08:19:38 +0900 (JST)
Subject: [ruby-changes:69000] 94cb5a6b1e (master): Implement opt_neq

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

From 94cb5a6b1e9243526af341b420ac1cb9c4de56c0 Mon Sep 17 00:00:00 2001
From: John Hawthorn <john@h...>
Date: Wed, 23 Jun 2021 13:15:28 -0700
Subject: Implement opt_neq

---
 yjit_codegen.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/yjit_codegen.c b/yjit_codegen.c
index d61206c2c1..7d9d19835a 100644
--- a/yjit_codegen.c
+++ b/yjit_codegen.c
@@ -1581,6 +1581,17 @@ gen_opt_eq(jitstate_t* jit, ctx_t* ctx) https://github.com/ruby/ruby/blob/trunk/yjit_codegen.c#L1581
 
 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
+gen_opt_neq(jitstate_t* jit, ctx_t* ctx)
+{
+    // opt_neq is passed two rb_call_data as arguments:
+    // first for ==, second for !=
+    struct rb_call_data *cd = (struct rb_call_data *)jit_get_arg(jit, 1);
+    return gen_send_general(jit, ctx, cd, NULL);
+}
+
 static codegen_status_t
 gen_opt_aref(jitstate_t *jit, ctx_t *ctx)
 {
@@ -3375,6 +3386,7 @@ yjit_init_codegen(void) https://github.com/ruby/ruby/blob/trunk/yjit_codegen.c#L3386
     yjit_reg_op(BIN(opt_ge), gen_opt_ge);
     yjit_reg_op(BIN(opt_gt), gen_opt_gt);
     yjit_reg_op(BIN(opt_eq), gen_opt_eq);
+    yjit_reg_op(BIN(opt_neq), gen_opt_neq);
     yjit_reg_op(BIN(opt_aref), gen_opt_aref);
     yjit_reg_op(BIN(opt_aset), gen_opt_aset);
     yjit_reg_op(BIN(opt_and), gen_opt_and);
-- 
cgit v1.2.1


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

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