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