File tree Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Expand file tree Collapse file tree 2 files changed +18
-0
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,16 @@ def mult(a, b)
36
36
mult(6, 2)
37
37
}
38
38
39
+ # Test for opt_div
40
+ assert_equal '3' , %q{
41
+ def div(a, b)
42
+ a / b
43
+ end
44
+
45
+ div(6, 2)
46
+ div(6, 2)
47
+ }
48
+
39
49
# BOP redefined methods work when JIT compiled
40
50
assert_equal 'false' , %q{
41
51
def less_than x
Original file line number Diff line number Diff line change @@ -1940,6 +1940,13 @@ gen_opt_mult(jitstate_t* jit, ctx_t* ctx)
1940
1940
return gen_opt_send_without_block (jit , ctx );
1941
1941
}
1942
1942
1943
+ static codegen_status_t
1944
+ gen_opt_div (jitstate_t * jit , ctx_t * ctx )
1945
+ {
1946
+ // Delegate to send, call the method on the recv
1947
+ return gen_opt_send_without_block (jit , ctx );
1948
+ }
1949
+
1943
1950
VALUE rb_vm_opt_mod (VALUE recv , VALUE obj );
1944
1951
1945
1952
static codegen_status_t
@@ -3470,6 +3477,7 @@ yjit_init_codegen(void)
3470
3477
yjit_reg_op (BIN (opt_minus ), gen_opt_minus );
3471
3478
yjit_reg_op (BIN (opt_plus ), gen_opt_plus );
3472
3479
yjit_reg_op (BIN (opt_mult ), gen_opt_mult );
3480
+ yjit_reg_op (BIN (opt_div ), gen_opt_div );
3473
3481
yjit_reg_op (BIN (opt_mod ), gen_opt_mod );
3474
3482
yjit_reg_op (BIN (opt_ltlt ), gen_opt_ltlt );
3475
3483
yjit_reg_op (BIN (opt_nil_p ), gen_opt_nil_p );
You can’t perform that action at this time.
0 commit comments