diff options
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | vm_core.h | 4 | ||||
-rw-r--r-- | vm_eval.c | 4 | ||||
-rw-r--r-- | vm_insnhelper.c | 7 |
4 files changed, 18 insertions, 6 deletions
@@ -1,3 +1,12 @@ +Fri Apr 3 11:43:17 2015 Nobuyoshi Nakada <nobu@ruby-lang.org> + + * vm_eval.c (vm_call0_cfunc): update invoker arguments. + + * vm_insnhelper.c (vm_call_cfunc_latter): ditto. + + * vm_insnhelper.c (rb_vm_call_cfunc_push_frame): ditto, and prefix + with rb_. + Thu Apr 2 16:26:59 2015 Nobuyoshi Nakada <nobu@ruby-lang.org> * common.mk, tool/mkconfig.rb: check the running ruby version in @@ -1035,8 +1035,8 @@ GET_THREAD(void) rb_thread_t *th = ruby_current_thread; #if OPT_CALL_CFUNC_WITHOUT_FRAME if (UNLIKELY(th->passed_ci != 0)) { - void vm_call_cfunc_push_frame(rb_thread_t *th); - vm_call_cfunc_push_frame(th); + void rb_vm_call_cfunc_push_frame(rb_thread_t *th); + rb_vm_call_cfunc_push_frame(th); } #endif return th; @@ -71,13 +71,15 @@ vm_call0_cfunc(rb_thread_t* th, rb_call_info_t *ci, const VALUE *argv) const rb_method_entry_t *me = ci->me; const rb_method_cfunc_t *cfunc = &me->def->body.cfunc; int len = cfunc->argc; + VALUE recv = ci->recv; + int argc = ci->argc; if (len >= 0) rb_check_arity(ci->argc, len, len); th->passed_ci = ci; ci->aux.inc_sp = 0; VM_PROFILE_UP(2); - val = (*cfunc->invoker)(cfunc->func, ci, argv); + val = (*cfunc->invoker)(cfunc->func, recv, argc, argv); if (reg_cfp == th->cfp) { if (UNLIKELY(th->passed_ci != ci)) { diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 0bede8f8ac..365a8bf773 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1436,13 +1436,14 @@ vm_call_cfunc_latter(rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_call_info_ VALUE val; int argc = ci->argc; VALUE *argv = STACK_ADDR_FROM_TOP(argc); + VALUE recv = ci->recv; const rb_method_cfunc_t *cfunc = vm_method_cfunc_entry(ci->me); th->passed_ci = ci; reg_cfp->sp -= argc + 1; ci->aux.inc_sp = argc + 1; VM_PROFILE_UP(0); - val = (*cfunc->invoker)(cfunc->func, ci, argv); + val = (*cfunc->invoker)(cfunc->func, recv, argc, argv); /* check */ if (reg_cfp == th->cfp) { /* no frame push */ @@ -1490,7 +1491,7 @@ vm_call_cfunc(rb_thread_t *th, rb_control_frame_t *reg_cfp, rb_call_info_t *ci) } void -vm_call_cfunc_push_frame(rb_thread_t *th) +rb_vm_call_cfunc_push_frame(rb_thread_t *th) { rb_call_info_t *ci = th->passed_ci; const rb_method_entry_t *me = ci->me; @@ -1498,7 +1499,7 @@ vm_call_cfunc_push_frame(rb_thread_t *th) vm_push_frame(th, 0, VM_FRAME_MAGIC_CFUNC, ci->recv, ci->defined_class, VM_ENVVAL_BLOCK_PTR(ci->blockptr), NULL /* cref */, - 0, th->cfp->sp + ci->aux.inc_sp, 1, me); + 0, th->cfp->sp + ci->aux.inc_sp, 1, me, 0); if (ci->call != vm_call_general) { ci->call = vm_call_cfunc_with_frame; |