mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
vm_insnhelper.c: inline function
* vm_insnhelper.c (vm_callee_setup_arg): turn a macro into an inline function. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@45320 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b3a613c8be
commit
ab9e4d11a3
2 changed files with 26 additions and 13 deletions
|
@ -1,3 +1,8 @@
|
||||||
|
Wed Mar 12 11:18:40 2014 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* vm_insnhelper.c (vm_callee_setup_arg): turn a macro into an
|
||||||
|
inline function.
|
||||||
|
|
||||||
Wed Mar 12 07:26:05 2014 Eric Wong <e@80x24.org>
|
Wed Mar 12 07:26:05 2014 Eric Wong <e@80x24.org>
|
||||||
|
|
||||||
* insns.def (opt_regexpmatch2): respect redefined match op
|
* insns.def (opt_regexpmatch2): respect redefined match op
|
||||||
|
|
|
@ -1196,23 +1196,31 @@ static VALUE vm_call_iseq_setup_2(rb_thread_t *th, rb_control_frame_t *cfp, rb_c
|
||||||
static inline VALUE vm_call_iseq_setup_normal(rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci);
|
static inline VALUE vm_call_iseq_setup_normal(rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci);
|
||||||
static inline VALUE vm_call_iseq_setup_tailcall(rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci);
|
static inline VALUE vm_call_iseq_setup_tailcall(rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci);
|
||||||
|
|
||||||
#define VM_CALLEE_SETUP_ARG(th, ci, iseq, argv, is_lambda) \
|
static inline void
|
||||||
if (LIKELY((iseq)->arg_simple & 0x01)) { \
|
vm_callee_setup_arg(rb_thread_t *th, rb_call_info_t *ci, const rb_iseq_t *iseq,
|
||||||
/* simple check */ \
|
VALUE *argv, int is_lambda)
|
||||||
if ((ci)->argc != (iseq)->argc) { \
|
{
|
||||||
argument_error((iseq), ((ci)->argc), (iseq)->argc, (iseq)->argc); \
|
if (LIKELY(iseq->arg_simple & 0x01)) {
|
||||||
} \
|
/* simple check */
|
||||||
(ci)->aux.opt_pc = 0; \
|
if (ci->argc != iseq->argc) {
|
||||||
CI_SET_FASTPATH((ci), UNLIKELY((ci)->flag & VM_CALL_TAILCALL) ? vm_call_iseq_setup_tailcall : vm_call_iseq_setup_normal, !(is_lambda) && !((ci)->me->flag & NOEX_PROTECTED)); \
|
argument_error(iseq, ci->argc, iseq->argc, iseq->argc);
|
||||||
} \
|
|
||||||
else { \
|
|
||||||
(ci)->aux.opt_pc = vm_callee_setup_arg_complex((th), (ci), (iseq), (argv)); \
|
|
||||||
}
|
}
|
||||||
|
ci->aux.opt_pc = 0;
|
||||||
|
CI_SET_FASTPATH(ci,
|
||||||
|
(UNLIKELY(ci->flag & VM_CALL_TAILCALL) ?
|
||||||
|
vm_call_iseq_setup_tailcall :
|
||||||
|
vm_call_iseq_setup_normal),
|
||||||
|
!is_lambda && !(ci->me->flag & NOEX_PROTECTED));
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
ci->aux.opt_pc = vm_callee_setup_arg_complex(th, ci, iseq, argv);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
static VALUE
|
static VALUE
|
||||||
vm_call_iseq_setup(rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci)
|
vm_call_iseq_setup(rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci)
|
||||||
{
|
{
|
||||||
VM_CALLEE_SETUP_ARG(th, ci, ci->me->def->body.iseq, cfp->sp - ci->argc, 0);
|
vm_callee_setup_arg(th, ci, ci->me->def->body.iseq, cfp->sp - ci->argc, 0);
|
||||||
return vm_call_iseq_setup_2(th, cfp, ci);
|
return vm_call_iseq_setup_2(th, cfp, ci);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2299,7 +2307,7 @@ vm_yield_setup_args(rb_thread_t * const th, const rb_iseq_t *iseq,
|
||||||
ci_entry.flag = 0;
|
ci_entry.flag = 0;
|
||||||
ci_entry.argc = argc;
|
ci_entry.argc = argc;
|
||||||
ci_entry.blockptr = (rb_block_t *)blockptr;
|
ci_entry.blockptr = (rb_block_t *)blockptr;
|
||||||
VM_CALLEE_SETUP_ARG(th, &ci_entry, iseq, argv, 1);
|
vm_callee_setup_arg(th, &ci_entry, iseq, argv, 1);
|
||||||
return ci_entry.aux.opt_pc;
|
return ci_entry.aux.opt_pc;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Add table
Reference in a new issue