diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-14 02:26:18 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-06-14 02:26:18 +0000 |
commit | d7e7f051e4ed8d0f69078f2d861d874a52ecc414 (patch) | |
tree | cf779c269e54eeb6dbcc8988e7c61ccc034dccb4 /vm_eval.c | |
parent | be1d07ca37d58b2d5fbd34c245d1461792396d89 (diff) | |
download | ruby-d7e7f051e4ed8d0f69078f2d861d874a52ecc414.tar.gz |
remove OPT_CALL_CFUNC_WITHOUT_FRAME.
* vm_core.h (OPT_CALL_CFUNC_WITHOUT_FRAME): removed because nobody use it.
This optimization tries to call C-methods without pushing VM frames,
however no big improvements compare with this complexity.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59076 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'vm_eval.c')
-rw-r--r-- | vm_eval.c | 42 |
1 files changed, 0 insertions, 42 deletions
@@ -59,47 +59,6 @@ vm_call0(rb_thread_t* th, VALUE recv, ID id, int argc, const VALUE *argv, const return vm_call0_body(th, calling, &ci_entry, &cc_entry, argv); } -#if OPT_CALL_CFUNC_WITHOUT_FRAME -static VALUE -vm_call0_cfunc(rb_thread_t* th, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc, const VALUE *argv) -{ - VALUE val; - - RUBY_DTRACE_CMETHOD_ENTRY_HOOK(th, cc->me->owner, ci->mid); - EXEC_EVENT_HOOK(th, RUBY_EVENT_C_CALL, calling->recv, ci->mid, ci->mid, cc->me->owner, Qnil); - { - rb_control_frame_t *reg_cfp = th->ec.cfp; - const rb_callable_method_entry_t *me = cc->me; - const rb_method_cfunc_t *cfunc = &me->def->body.cfunc; - int len = cfunc->argc; - VALUE recv = calling->recv; - int argc = calling->argc; - - if (len >= 0) rb_check_arity(argc, len, len); - - th->passed_ci = ci; - cc->aux.inc_sp = 0; - VM_PROFILE_UP(C2C_CALL); - val = (*cfunc->invoker)(cfunc->func, recv, argc, argv); - - if (reg_cfp == th->ec.cfp) { - if (UNLIKELY(th->passed_ci != ci)) { - rb_bug("vm_call0_cfunc: passed_ci error (ci: %p, passed_ci: %p)", ci, th->passed_ci); - } - th->passed_ci = 0; - } - else { - CHECK_CFP_CONSISTENCY("vm_call0_cfunc"); - VM_PROFILE_UP(C2C_POPF); - rb_vm_pop_frame(th); - } - } - EXEC_EVENT_HOOK(th, RUBY_EVENT_C_RETURN, calling->recv, ci->mid, ci->mid, callnig->cc->me->owner, val); - RUBY_DTRACE_CMETHOD_RETURN_HOOK(th, cc->me->owner, ci->mid); - - return val; -} -#else static VALUE vm_call0_cfunc_with_frame(rb_thread_t* th, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc, const VALUE *argv) { @@ -141,7 +100,6 @@ vm_call0_cfunc(rb_thread_t* th, struct rb_calling_info *calling, const struct rb { return vm_call0_cfunc_with_frame(th, calling, ci, cc, argv); } -#endif /* `ci' should point temporal value (on stack value) */ static VALUE |