summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--yjit_codegen.c8
-rw-r--r--yjit_iface.h1
2 files changed, 4 insertions, 5 deletions
diff --git a/yjit_codegen.c b/yjit_codegen.c
index 127027ffa7..fc4d46a329 100644
--- a/yjit_codegen.c
+++ b/yjit_codegen.c
@@ -1453,10 +1453,9 @@ gen_get_ivar(jitstate_t *jit, ctx_t *ctx, const int max_chain_depth, VALUE compt
mov(cb, REG1, ivar_opnd);
// Guard that the variable is not Qundef
- // TODO: use cmov to push Qnil in this case
- ADD_COMMENT(cb, "guard value not Qundef");
cmp(cb, REG1, imm_opnd(Qundef));
- je_ptr(cb, COUNTED_EXIT(side_exit, getivar_undef));
+ mov(cb, REG0, imm_opnd(Qnil));
+ cmove(cb, REG1, REG0);
// Push the ivar on the stack
x86opnd_t out_opnd = ctx_stack_push(ctx, TYPE_UNKNOWN);
@@ -1490,7 +1489,8 @@ gen_get_ivar(jitstate_t *jit, ctx_t *ctx, const int max_chain_depth, VALUE compt
// Check that the ivar is not Qundef
cmp(cb, REG0, imm_opnd(Qundef));
- je_ptr(cb, COUNTED_EXIT(side_exit, getivar_undef));
+ mov(cb, REG1, imm_opnd(Qnil));
+ cmove(cb, REG0, REG1);
// Push the ivar on the stack
x86opnd_t out_opnd = ctx_stack_push(ctx, TYPE_UNKNOWN);
diff --git a/yjit_iface.h b/yjit_iface.h
index 489803a537..4b3da00b76 100644
--- a/yjit_iface.h
+++ b/yjit_iface.h
@@ -52,7 +52,6 @@ YJIT_DECLARE_COUNTERS(
getivar_se_self_not_heap,
getivar_idx_out_of_range,
- getivar_undef,
getivar_name_not_mapped,
setivar_se_self_not_heap,