summaryrefslogtreecommitdiff
path: root/yjit_codegen.c
diff options
context:
space:
mode:
authorJohn Hawthorn <[email protected]>2021-08-12 12:02:43 -0700
committerAlan Wu <[email protected]>2021-10-20 18:19:40 -0400
commit6db5e80dd7e91fcfaf55727dbe24619d964cfac4 (patch)
tree0b8e1e531b3d50c7e566d8b3e15a238312a28b6c /yjit_codegen.c
parent692f94ba0c878b30ebf96480b0f7e58f7f0ffa08 (diff)
Use method dispatch for opt_eq
Diffstat (limited to 'yjit_codegen.c')
-rw-r--r--yjit_codegen.c26
1 files 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)
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