@@ -1627,10 +1627,35 @@ gen_opt_mod(jitstate_t* jit, ctx_t* ctx)
1627
1627
static codegen_status_t
1628
1628
gen_opt_ltlt (jitstate_t * jit , ctx_t * ctx )
1629
1629
{
1630
- // Delegate to send, call the ltlt method
1630
+ // Delegate to send, call the method on the recv
1631
1631
return gen_opt_send_without_block (jit , ctx );
1632
1632
}
1633
1633
1634
+ static codegen_status_t
1635
+ gen_opt_nil_p (jitstate_t * jit , ctx_t * ctx )
1636
+ {
1637
+ // Delegate to send, call the method on the recv
1638
+ return gen_opt_send_without_block (jit , ctx );
1639
+ }
1640
+
1641
+ static codegen_status_t
1642
+ gen_opt_empty_p (jitstate_t * jit , ctx_t * ctx )
1643
+ {
1644
+ // Delegate to send, call the method on the recv
1645
+ return gen_opt_send_without_block (jit , ctx );
1646
+ }
1647
+
1648
+ static codegen_status_t
1649
+ gen_opt_not (jitstate_t * jit , ctx_t * ctx )
1650
+ {
1651
+ // TODO: can we implement a fast path?
1652
+ // Most likely, almost every input to opt_not is true/false/nil?
1653
+
1654
+ // NOTE: we can't really delegate to OSWB because we currently
1655
+ // don't support calls to methods on true/false/nil
1656
+ return YJIT_CANT_COMPILE ;
1657
+ }
1658
+
1634
1659
void
1635
1660
gen_branchif_branch (codeblock_t * cb , uint8_t * target0 , uint8_t * target1 , uint8_t shape )
1636
1661
{
@@ -2661,6 +2686,9 @@ yjit_init_codegen(void)
2661
2686
yjit_reg_op (BIN (opt_plus ), gen_opt_plus );
2662
2687
yjit_reg_op (BIN (opt_mod ), gen_opt_mod );
2663
2688
yjit_reg_op (BIN (opt_ltlt ), gen_opt_ltlt );
2689
+ yjit_reg_op (BIN (opt_nil_p ), gen_opt_nil_p );
2690
+ yjit_reg_op (BIN (opt_empty_p ), gen_opt_empty_p );
2691
+ yjit_reg_op (BIN (opt_not ), gen_opt_not );
2664
2692
yjit_reg_op (BIN (opt_getinlinecache ), gen_opt_getinlinecache );
2665
2693
yjit_reg_op (BIN (branchif ), gen_branchif );
2666
2694
yjit_reg_op (BIN (branchunless ), gen_branchunless );
0 commit comments