Skip to content

Commit 179062d

Browse files
committed
move rb_vm_lvar_exposed() correctly.
rb_vm_lvar_exposed() is prepared for __builtin_inline!(), needed for mini_builtin.c and builtin.c. However, it's only on builtin.c. So move it to make it as a part of VM.
1 parent a8f9e25 commit 179062d

File tree

2 files changed

+9
-8
lines changed

2 files changed

+9
-8
lines changed

builtin.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,3 @@ Init_builtin(void)
4141
{
4242
//
4343
}
44-
45-
// inline
46-
VALUE
47-
rb_vm_lvar_exposed(rb_execution_context_t *ec, int index)
48-
{
49-
const rb_control_frame_t *cfp = ec->cfp;
50-
return cfp->ep[index];
51-
}

vm_insnhelper.c

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4995,3 +4995,12 @@ vm_invoke_builtin_delegate(rb_execution_context_t *ec, rb_control_frame_t *cfp,
49954995
// fprintf(stderr, "%s %s(%d):%p\n", __func__, bf->name, bf->argc, bf->func_ptr);
49964996
return invoke_bf(ec, cfp, bf, argv);
49974997
}
4998+
4999+
// for __builtin_inline!()
5000+
5001+
VALUE
5002+
rb_vm_lvar_exposed(rb_execution_context_t *ec, int index)
5003+
{
5004+
const rb_control_frame_t *cfp = ec->cfp;
5005+
return cfp->ep[index];
5006+
}

0 commit comments

Comments
 (0)