aboutsummaryrefslogtreecommitdiffstats
path: root/vm_insnhelper.c
diff options
context:
space:
mode:
authorKoichi Sasada <ko1@atdot.net>2019-11-14 04:18:41 +0900
committerKoichi Sasada <ko1@atdot.net>2019-11-14 04:21:24 +0900
commit179062dd808c0a48e16269a2c42b10235cbbacd8 (patch)
tree8d7d4292aec538f670eaa8be0c9763c6ee7945e9 /vm_insnhelper.c
parenta8f9e25ca8cc160683711baed00008461db2ad16 (diff)
downloadruby-179062dd808c0a48e16269a2c42b10235cbbacd8.tar.gz
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.
Diffstat (limited to 'vm_insnhelper.c')
-rw-r--r--vm_insnhelper.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/vm_insnhelper.c b/vm_insnhelper.c
index 205b4d915f..e5a7c77e91 100644
--- a/vm_insnhelper.c
+++ b/vm_insnhelper.c
@@ -4995,3 +4995,12 @@ vm_invoke_builtin_delegate(rb_execution_context_t *ec, rb_control_frame_t *cfp,
// fprintf(stderr, "%s %s(%d):%p\n", __func__, bf->name, bf->argc, bf->func_ptr);
return invoke_bf(ec, cfp, bf, argv);
}
+
+// for __builtin_inline!()
+
+VALUE
+rb_vm_lvar_exposed(rb_execution_context_t *ec, int index)
+{
+ const rb_control_frame_t *cfp = ec->cfp;
+ return cfp->ep[index];
+}