8000 Only compile iseqs with simple parameters. Enable get_local_wc1 · github/ruby@d2ba05a · GitHub
[go: up one dir, main page]

Skip to content

Commit d2ba05a

Browse files
committed
Only compile iseqs with simple parameters. Enable get_local_wc1
1 parent b551bbb commit d2ba05a

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

ujit_codegen.c

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1112,6 +1112,8 @@ gen_opt_swb_cfunc(jitstate_t* jit, ctx_t* ctx, struct rb_call_data * cd, const r
11121112
return true;
11131113
}
11141114

1115+
bool rb_simple_iseq_p(const rb_iseq_t *iseq);
1116+
11151117
static bool
11161118
gen_opt_swb_iseq(jitstate_t* jit, ctx_t* ctx, struct rb_call_data * cd, const rb_callable_method_entry_t *cme, int32_t argc)
11171119
{
@@ -1120,13 +1122,19 @@ gen_opt_swb_iseq(jitstate_t* jit, ctx_t* ctx, struct rb_call_data * cd, const rb
11201122
int num_params = iseq->body->param.size;
11211123
int num_locals = iseq->body->local_table_size - num_params;
11221124

1123-
rb_gc_register_mark_object((VALUE)iseq); // FIXME: intentional LEAK!
1124-
11251125
if (num_params != argc) {
11261126
//fprintf(stderr, "param argc mismatch\n");
11271127
return false;
11281128
}
11291129

1130+
if (!rb_simple_iseq_p(iseq)) {
1131+
// Only handle iseqs that have simple parameters.
1132+
// See vm_callee_setup_arg().
1133+
return false;
1134+
}
1135+
1136+
rb_gc_register_mark_object((VALUE)iseq); // FIXME: intentional LEAK!
1137+
11301138
// Create a size-exit to fall back to the interpreter
11311139
uint8_t* side_exit = ujit_side_exit(jit, ctx);
11321140

@@ -1375,7 +1383,7 @@ ujit_init_codegen(void)
13751383
ujit_reg_op(BIN(putobject_INT2FIX_1_), gen_putobject_int2fix, false);
13761384
ujit_reg_op(BIN(putself), gen_putself, false);
13771385
ujit_reg_op(BIN(getlocal_WC_0), gen_getlocal_wc0, false);
1378-
//ujit_reg_op(BIN(getlocal_WC_1), gen_getlocal_wc1, false);
1386+
ujit_reg_op(BIN(getlocal_WC_1), gen_getlocal_wc1, false);
13791387
ujit_reg_op(BIN(setlocal_WC_0), gen_setlocal_wc0, false);
13801388
ujit_reg_op(BIN(getinstancevariable), gen_getinstancevariable, false);
13811389
ujit_reg_op(BIN(setinstancevariable), gen_setinstancevariable, false);

0 commit comments

Comments
 (0)
0