diff options
author | John Hawthorn <john@hawthorn.email> | 2021-06-23 13:15:28 -0700 |
---|---|---|
committer | Alan Wu <XrXr@users.noreply.github.com> | 2021-10-20 18:19:36 -0400 |
commit | 94cb5a6b1e9243526af341b420ac1cb9c4de56c0 (patch) | |
tree | 369cf222ca19dd6b0340bf31daf2dbc663753329 | |
parent | 3996e0ab07d06b7685eecd56a542e9672702dee2 (diff) | |
download | ruby-94cb5a6b1e9243526af341b420ac1cb9c4de56c0.tar.gz |
Implement opt_neq
-rw-r--r-- | yjit_codegen.c | 12 |
1 files changed, 12 insertions, 0 deletions
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) 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) 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); |