@@ -2872,16 +2872,15 @@ fn gen_opt_div(jit: &mut JITState, ctx: &mut Context, cb: &mut CodeBlock, ocb: &
2872
2872
// Delegate to send, call the method on the recv
2873
2873
return gen_opt_send_without_block(jit, ctx, cb);
2874
2874
}
2875
-
2876
- VALUE rb_vm_opt_mod(VALUE recv, VALUE obj);
2875
+ */
2877
2876
2878
2877
fn gen_opt_mod ( jit : & mut JITState , ctx : & mut Context , cb : & mut CodeBlock , ocb : & mut OutlinedCb ) -> CodegenStatus
2879
2878
{
2880
2879
// Save the PC and SP because the callee may allocate bignums
2881
2880
// Note that this modifies REG_SP, which is why we do it first
2882
- jit_prepare_routine_call(jit, ctx, REG0);
2881
+ jit_prepare_routine_call ( jit, ctx, cb , REG0 ) ;
2883
2882
2884
- uint8_t * side_exit = get_side_exit(jit, ocb, ctx);
2883
+ let side_exit = get_side_exit ( jit, ocb, ctx) ;
2885
2884
2886
2885
// Get the operands from the stack
2887
2886
let arg1 = ctx. stack_pop ( 1 ) ;
@@ -2890,10 +2889,11 @@ fn gen_opt_mod(jit: &mut JITState, ctx: &mut Context, cb: &mut CodeBlock, ocb: &
2890
2889
// Call rb_vm_opt_mod(VALUE recv, VALUE obj)
2891
2890
mov ( cb, C_ARG_REGS [ 0 ] , arg0) ;
2892
2891
mov ( cb, C_ARG_REGS [ 1 ] , arg1) ;
2893
- call_ptr(cb, REG0, (void *)rb_vm_opt_mod);
2892
+ let vm_mod = CodePtr :: from ( rb_vm_opt_mod as * mut u8 ) ;
2893
+ call_ptr ( cb, REG0 , vm_mod) ;
2894
2894
2895
2895
// If val == Qundef, bail to do a method call
2896
- cmp(cb, RAX, imm_opnd(Qundef));
2896
+ cmp ( cb, RAX , imm_opnd ( Qundef . as_i64 ( ) ) ) ;
2897
2897
je_ptr ( cb, side_exit) ;
2898
2898
2899
2899
// Push the return value onto the stack
@@ -2903,6 +2903,7 @@ fn gen_opt_mod(jit: &mut JITState, ctx: &mut Context, cb: &mut CodeBlock, ocb: &
2903
2903
KeepCompiling
2904
2904
}
2905
2905
2906
+ /*
2906
2907
fn gen_opt_ltlt(jit: &mut JITState, ctx: &mut Context, cb: &mut CodeBlock, ocb: &mut OutlinedCb) -> CodegenStatus
2907
2908
{
2908
2909
// Delegate to send, call the method on the recv
@@ -2920,14 +2921,17 @@ fn gen_opt_empty_p(jit: &mut JITState, ctx: &mut Context, cb: &mut CodeBlock, oc
2920
2921
// Delegate to send, call the method on the recv
2921
2922
return gen_opt_send_without_block(jit, ctx, cb);
2922
2923
}
2924
+ */
2923
2925
2924
2926
fn gen_opt_str_freeze ( jit : & mut JITState , ctx : & mut Context , cb : & mut CodeBlock , ocb : & mut OutlinedCb ) -> CodegenStatus
2925
2927
{
2928
+ /*
2926
2929
if (!assume_bop_not_redefined(jit, STRING_REDEFINED_OP_FLAG, BOP_FREEZE)) {
2927
2930
return CantCompile;
2928
2931
}
2932
+ */
2929
2933
2930
- VALUE str = jit_get_arg(jit, 0);
2934
+ let str = jit_get_arg ( jit, 0 ) ;
2931
2935
jit_mov_gc_ptr ( jit, cb, REG0 , str) ;
2932
2936
2933
2937
// Push the return value onto the stack
@@ -2939,11 +2943,13 @@ fn gen_opt_str_freeze(jit: &mut JITState, ctx: &mut Context, cb: &mut CodeBlock,
2939
2943
2940
2944
fn gen_opt_str_uminus ( jit : & mut JITState , ctx : & mut Context , cb : & mut CodeBlock , ocb : & mut OutlinedCb ) -> CodegenStatus
2941
2945
{
2946
+ /*
2942
2947
if (!assume_bop_not_redefined(jit, STRING_REDEFINED_OP_FLAG, BOP_UMINUS)) {
2943
2948
return CantCompile;
2944
2949
}
2950
+ */
2945
2951
2946
- VALUE str = jit_get_arg(jit, 0);
2952
+ let str = jit_get_arg ( jit, 0 ) ;
2947
2953
jit_mov_gc_ptr ( jit, cb, REG0 , str) ;
2948
2954
2949
2955
// Push the return value onto the stack
@@ -2953,6 +2959,7 @@ fn gen_opt_str_uminus(jit: &mut JITState, ctx: &mut Context, cb: &mut CodeBlock,
2953
2959
KeepCompiling
2954
2960
}
2955
2961
2962
+ /*
2956
2963
fn gen_opt_not(jit: &mut JITState, ctx: &mut Context, cb: &mut CodeBlock, ocb: &mut OutlinedCb) -> CodegenStatus
2957
2964
{
2958
2965
return gen_opt_send_without_block(jit, ctx, cb);
@@ -5238,6 +5245,9 @@ fn get_gen_fn(opcode: VALUE) -> Option<CodeGenFn>
5238
5245
OP_OPT_LE => Some ( gen_opt_le) ,
5239
5246
OP_OPT_GT => Some ( gen_opt_gt) ,
5240
5247
OP_OPT_GE => Some ( gen_opt_ge) ,
5248
+ OP_OPT_MOD => Some ( gen_opt_mod) ,
5249
+ OP_OPT_STR_FREEZE => Some ( gen_opt_str_freeze) ,
5250
+ OP_OPT_STR_UMINUS => Some ( gen_opt_str_uminus) ,
5241
5251
5242
5252
/*
5243
5253
yjit_reg_op(BIN(newarray), gen_newarray);
@@ -5258,12 +5268,9 @@ fn get_gen_fn(opcode: VALUE) -> Option<CodeGenFn>
5258
5268
yjit_reg_op(BIN(opt_aset), gen_opt_aset);
5259
5269
yjit_reg_op(BIN(opt_mult), gen_opt_mult);
5260
5270
yjit_reg_op(BIN(opt_div), gen_opt_div);
5261
- yjit_reg_op(BIN(opt_mod), gen_opt_mod);
5262
5271
yjit_reg_op(BIN(opt_ltlt), gen_opt_ltlt);
5263
5272
yjit_reg_op(BIN(opt_nil_p), gen_opt_nil_p);
5264
5273
yjit_reg_op(BIN(opt_empty_p), gen_opt_empty_p);
5265
- yjit_reg_op(BIN(opt_str_freeze), gen_opt_str_freeze);
5266
- yjit_reg_op(BIN(opt_str_uminus), gen_opt_str_uminus);
5267
5274
yjit_reg_op(BIN(opt_not), gen_opt_not);
5268
5275
yjit_reg_op(BIN(opt_size), gen_opt_size);
5269
5276
yjit_reg_op(BIN(opt_length), gen_opt_length);
0 commit comments