@@ -1451,10 +1451,9 @@ gen_get_ivar(jitstate_t *jit, ctx_t *ctx, const int max_chain_depth, VALUE compt
14511451 mov (cb , REG1 , ivar_opnd );
14521452
14531453 // Guard that the variable is not Qundef
1454- // TODO: use cmov to push Qnil in this case
1455- ADD_COMMENT (cb , "guard value not Qundef" );
14561454 cmp (cb , REG1 , imm_opnd (Qundef ));
1457- je_ptr (cb , COUNTED_EXIT (side_exit , getivar_undef ));
1455+ mov (cb , REG0 , imm_opnd (Qnil ));
1456+ cmove (cb , REG1 , REG0 );
14581457
14591458 // Push the ivar on the stack
14601459 x86opnd_t out_opnd = ctx_stack_push (ctx , TYPE_UNKNOWN );
@@ -1488,7 +1487,8 @@ gen_get_ivar(jitstate_t *jit, ctx_t *ctx, const int max_chain_depth, VALUE compt
14881487
14891488 // Check that the ivar is not Qundef
14901489 cmp (cb , REG0 , imm_opnd (Qundef ));
1491- je_ptr (cb , COUNTED_EXIT (side_exit , getivar_undef ));
1490+ mov (cb , REG1 , imm_opnd (Qnil ));
1491+ cmove (cb , REG0 , REG1 );
14921492
14931493 // Push the ivar on the stack
14941494 x86opnd_t out_opnd = ctx_stack_push (ctx , TYPE_UNKNOWN );
0 commit comments