ruby-changes:52560
From: k0kubun <ko1@a...>
Date: Tue, 18 Sep 2018 21:48:33 +0900 (JST)
Subject: [ruby-changes:52560] k0kubun:r64772 (trunk): vm_insnhelper.h: rename CI_SET_FASTPATH to CC_SET_FASTPATH
k0kubun 2018-09-18 21:48:28 +0900 (Tue, 18 Sep 2018) New Revision: 64772 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64772 Log: vm_insnhelper.h: rename CI_SET_FASTPATH to CC_SET_FASTPATH because it's actually setting fastpath to cc instead of ci since r51903. vm_insnhelper.c: ditto mjit_compile.c: ditto tool/ruby_vm/views/_mjit_compile_send.erb: ditto Modified files: trunk/mjit_compile.c trunk/tool/ruby_vm/views/_mjit_compile_send.erb trunk/vm_insnhelper.c trunk/vm_insnhelper.h Index: vm_insnhelper.h =================================================================== --- vm_insnhelper.h (revision 64771) +++ vm_insnhelper.h (revision 64772) @@ -177,7 +177,7 @@ enum vm_regan_acttype { https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.h#L177 * because inline method cache does not care about receiver. */ -#define CI_SET_FASTPATH(cc, func, enabled) do { \ +#define CC_SET_FASTPATH(cc, func, enabled) do { \ if (LIKELY(enabled)) ((cc)->call = (func)); \ } while (0) Index: tool/ruby_vm/views/_mjit_compile_send.erb =================================================================== --- tool/ruby_vm/views/_mjit_compile_send.erb (revision 64771) +++ tool/ruby_vm/views/_mjit_compile_send.erb (revision 64772) @@ -21,7 +21,7 @@ https://github.com/ruby/ruby/blob/trunk/tool/ruby_vm/views/_mjit_compile_send.erb#L21 argc += ((ci->flag & VM_CALL_ARGS_BLOCKARG) ? 1 : 0); % end - if (cc->me->def->type == VM_METHOD_TYPE_ISEQ && inlinable_iseq_p(ci, cc, iseq = rb_iseq_check(cc->me->def->body.iseq.iseqptr))) { /* CI_SET_FASTPATH in vm_callee_setup_arg */ + if (cc->me->def->type == VM_METHOD_TYPE_ISEQ && inlinable_iseq_p(ci, cc, iseq = rb_iseq_check(cc->me->def->body.iseq.iseqptr))) { /* CC_SET_FASTPATH in vm_callee_setup_arg */ int param_size = iseq->body->param.size; /* TODO: check calling->argc for argument_arity_error */ fprintf(f, "{\n"); Index: vm_insnhelper.c =================================================================== --- vm_insnhelper.c (revision 64771) +++ vm_insnhelper.c (revision 64772) @@ -1625,7 +1625,7 @@ vm_callee_setup_arg(rb_execution_context https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1625 argument_arity_error(ec, iseq, calling->argc, iseq->body->param.lead_num, iseq->body->param.lead_num); } - CI_SET_FASTPATH(cc, vm_call_iseq_setup_func(ci, param_size, local_size), + CC_SET_FASTPATH(cc, vm_call_iseq_setup_func(ci, param_size, local_size), (!IS_ARGS_SPLAT(ci) && !IS_ARGS_KEYWORD(ci) && !(METHOD_ENTRY_VISI(cc->me) == METHOD_VISI_PROTECTED))); return 0; @@ -2261,35 +2261,35 @@ vm_call_method_each_type(rb_execution_co https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2261 { switch (cc->me->def->type) { case VM_METHOD_TYPE_ISEQ: - CI_SET_FASTPATH(cc, vm_call_iseq_setup, TRUE); + CC_SET_FASTPATH(cc, vm_call_iseq_setup, TRUE); return vm_call_iseq_setup(ec, cfp, calling, ci, cc); case VM_METHOD_TYPE_NOTIMPLEMENTED: case VM_METHOD_TYPE_CFUNC: - CI_SET_FASTPATH(cc, vm_call_cfunc, TRUE); + CC_SET_FASTPATH(cc, vm_call_cfunc, TRUE); return vm_call_cfunc(ec, cfp, calling, ci, cc); case VM_METHOD_TYPE_ATTRSET: CALLER_SETUP_ARG(cfp, calling, ci); rb_check_arity(calling->argc, 1, 1); cc->aux.index = 0; - CI_SET_FASTPATH(cc, vm_call_attrset, !((ci->flag & VM_CALL_ARGS_SPLAT) || (ci->flag & VM_CALL_KWARG))); + CC_SET_FASTPATH(cc, vm_call_attrset, !((ci->flag & VM_CALL_ARGS_SPLAT) || (ci->flag & VM_CALL_KWARG))); return vm_call_attrset(ec, cfp, calling, ci, cc); case VM_METHOD_TYPE_IVAR: CALLER_SETUP_ARG(cfp, calling, ci); rb_check_arity(calling->argc, 0, 0); cc->aux.index = 0; - CI_SET_FASTPATH(cc, vm_call_ivar, !(ci->flag & VM_CALL_ARGS_SPLAT)); + CC_SET_FASTPATH(cc, vm_call_ivar, !(ci->flag & VM_CALL_ARGS_SPLAT)); return vm_call_ivar(ec, cfp, calling, ci, cc); case VM_METHOD_TYPE_MISSING: cc->aux.method_missing_reason = 0; - CI_SET_FASTPATH(cc, vm_call_method_missing, TRUE); + CC_SET_FASTPATH(cc, vm_call_method_missing, TRUE); return vm_call_method_missing(ec, cfp, calling, ci, cc); case VM_METHOD_TYPE_BMETHOD: - CI_SET_FASTPATH(cc, vm_call_bmethod, TRUE); + CC_SET_FASTPATH(cc, vm_call_bmethod, TRUE); return vm_call_bmethod(ec, cfp, calling, ci, cc); case VM_METHOD_TYPE_ALIAS: @@ -2300,13 +2300,13 @@ vm_call_method_each_type(rb_execution_co https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2300 case VM_METHOD_TYPE_OPTIMIZED: switch (cc->me->def->body.optimize_type) { case OPTIMIZED_METHOD_TYPE_SEND: - CI_SET_FASTPATH(cc, vm_call_opt_send, TRUE); + CC_SET_FASTPATH(cc, vm_call_opt_send, TRUE); return vm_call_opt_send(ec, cfp, calling, ci, cc); case OPTIMIZED_METHOD_TYPE_CALL: - CI_SET_FASTPATH(cc, vm_call_opt_call, TRUE); + CC_SET_FASTPATH(cc, vm_call_opt_call, TRUE); return vm_call_opt_call(ec, cfp, calling, ci, cc); case OPTIMIZED_METHOD_TYPE_BLOCK_CALL: - CI_SET_FASTPATH(cc, vm_call_opt_block_call, TRUE); + CC_SET_FASTPATH(cc, vm_call_opt_block_call, TRUE); return vm_call_opt_block_call(ec, cfp, calling, ci, cc); default: rb_bug("vm_call_method: unsupported optimized method type (%d)", @@ -2380,7 +2380,7 @@ vm_call_method_nome(rb_execution_context https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2380 } else { cc->aux.method_missing_reason = stat; - CI_SET_FASTPATH(cc, vm_call_method_missing, 1); + CC_SET_FASTPATH(cc, vm_call_method_missing, 1); return vm_call_method_missing(ec, cfp, calling, ci, cc); } } @@ -2401,7 +2401,7 @@ vm_call_method(rb_execution_context_t *e https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2401 if (ci->flag & VM_CALL_VCALL) stat |= MISSING_VCALL; cc->aux.method_missing_reason = stat; - CI_SET_FASTPATH(cc, vm_call_method_missing, 1); + CC_SET_FASTPATH(cc, vm_call_method_missing, 1); return vm_call_method_missing(ec, cfp, calling, ci, cc); } return vm_call_method_each_type(ec, cfp, calling, ci, cc); @@ -2511,12 +2511,12 @@ vm_search_super_method(const rb_executio https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2511 if (!klass) { /* bound instance method of module */ cc->aux.method_missing_reason = MISSING_SUPER; - CI_SET_FASTPATH(cc, vm_call_method_missing, TRUE); + CC_SET_FASTPATH(cc, vm_call_method_missing, TRUE); } else { /* TODO: use inline cache */ cc->me = rb_callable_method_entry(klass, ci->mid); - CI_SET_FASTPATH(cc, vm_call_super_method, TRUE); + CC_SET_FASTPATH(cc, vm_call_super_method, TRUE); } } Index: mjit_compile.c =================================================================== --- mjit_compile.c (revision 64771) +++ mjit_compile.c (revision 64772) @@ -57,14 +57,14 @@ has_valid_method_type(CALL_CACHE cc) https://github.com/ruby/ruby/blob/trunk/mjit_compile.c#L57 } /* Returns TRUE if iseq is inlinable, otherwise NULL. This becomes TRUE in the same condition - as CI_SET_FASTPATH (in vm_callee_setup_arg) is called from vm_call_iseq_setup. */ + as CC_SET_FASTPATH (in vm_callee_setup_arg) is called from vm_call_iseq_setup. */ static int inlinable_iseq_p(CALL_INFO ci, CALL_CACHE cc, const rb_iseq_t *iseq) { extern int rb_simple_iseq_p(const rb_iseq_t *iseq); return iseq != NULL && rb_simple_iseq_p(iseq) && !(ci->flag & VM_CALL_KW_SPLAT) /* Top of vm_callee_setup_arg. In this case, opt_pc is 0. */ - && (!IS_ARGS_SPLAT(ci) && !IS_ARGS_KEYWORD(ci) && !(METHOD_ENTRY_VISI(cc->me) == METHOD_VISI_PROTECTED)); /* CI_SET_FASTPATH */ + && (!IS_ARGS_SPLAT(ci) && !IS_ARGS_KEYWORD(ci) && !(METHOD_ENTRY_VISI(cc->me) == METHOD_VISI_PROTECTED)); /* CC_SET_FASTPATH */ } static int -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/