ruby-changes:51821
From: k0kubun <ko1@a...>
Date: Wed, 25 Jul 2018 00:17:15 +0900 (JST)
Subject: [ruby-changes:51821] k0kubun:r64035 (trunk): vm.c: simplify the implementation of r64031
k0kubun 2018-07-25 00:17:08 +0900 (Wed, 25 Jul 2018) New Revision: 64035 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=64035 Log: vm.c: simplify the implementation of r64031 because such inconsistency may result in the regression fixed in r64034. vm_exec is not touched since renaming it may be controversial... vm_args.c: ditto. vm_eval.c: ditto. vm_insnhelper.c: ditto. vm_method.c: ditto. Modified files: trunk/vm.c trunk/vm_args.c trunk/vm_eval.c trunk/vm_insnhelper.c trunk/vm_method.c Index: vm_eval.c =================================================================== --- vm_eval.c (revision 64034) +++ vm_eval.c (revision 64035) @@ -41,7 +41,7 @@ static VALUE vm_call0_body(rb_execution_ https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L41 #ifndef MJIT_HEADER MJIT_FUNC_EXPORTED VALUE -vm_call0(rb_execution_context_t *ec, VALUE recv, ID id, int argc, const VALUE *argv, const rb_callable_method_entry_t *me) +rb_vm_call0(rb_execution_context_t *ec, VALUE recv, ID id, int argc, const VALUE *argv, const rb_callable_method_entry_t *me) { struct rb_calling_info calling_entry, *calling; struct rb_call_info ci_entry; @@ -206,7 +206,7 @@ vm_call0_body(rb_execution_context_t *ec https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L206 VALUE rb_vm_call(rb_execution_context_t *ec, VALUE recv, VALUE id, int argc, const VALUE *argv, const rb_callable_method_entry_t *me) { - return vm_call0(ec, recv, id, argc, argv, me); + return rb_vm_call0(ec, recv, id, argc, argv, me); } static inline VALUE @@ -231,7 +231,7 @@ vm_call_super(rb_execution_context_t *ec https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L231 return method_missing(recv, id, argc, argv, MISSING_SUPER); } else { - return vm_call0(ec, recv, id, argc, argv, me); + return rb_vm_call0(ec, recv, id, argc, argv, me); } } @@ -299,7 +299,7 @@ rb_call0(rb_execution_context_t *ec, https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L299 return method_missing(recv, mid, argc, argv, call_status); } stack_check(ec); - return vm_call0(ec, recv, mid, argc, argv, me); + return rb_vm_call0(ec, recv, mid, argc, argv, me); } struct rescue_funcall_args { @@ -417,7 +417,7 @@ rb_check_funcall_default(VALUE recv, ID https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L417 return ret; } stack_check(ec); - return vm_call0(ec, recv, mid, argc, argv, me); + return rb_vm_call0(ec, recv, mid, argc, argv, me); } VALUE @@ -443,7 +443,7 @@ rb_check_funcall_with_hook(VALUE recv, I https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L443 } stack_check(ec); (*hook)(TRUE, recv, mid, argc, argv, arg); - return vm_call0(ec, recv, mid, argc, argv, me); + return rb_vm_call0(ec, recv, mid, argc, argv, me); } const char * @@ -735,7 +735,7 @@ method_missing(VALUE obj, ID id, int arg https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L735 me = rb_callable_method_entry(klass, idMethodMissing); if (!me || METHOD_ENTRY_BASIC(me)) goto missing; vm_passed_block_handler_set(ec, block_handler); - result = vm_call0(ec, obj, idMethodMissing, argc, argv, me); + result = rb_vm_call0(ec, obj, idMethodMissing, argc, argv, me); if (work) ALLOCV_END(work); return result; } Index: vm_method.c =================================================================== --- vm_method.c (revision 64034) +++ vm_method.c (revision 64035) @@ -1913,7 +1913,7 @@ call_method_entry(rb_execution_context_t https://github.com/ruby/ruby/blob/trunk/vm_method.c#L1913 const rb_callable_method_entry_t *cme = prepare_callable_method_entry(defined_class, id, me); VALUE passed_block_handler = vm_passed_block_handler(ec); - VALUE result = vm_call0(ec, obj, id, argc, argv, cme); + VALUE result = rb_vm_call0(ec, obj, id, argc, argv, cme); vm_passed_block_handler_set(ec, passed_block_handler); return result; } Index: vm.c =================================================================== --- vm.c (revision 64034) +++ vm.c (revision 64035) @@ -12,10 +12,7 @@ https://github.com/ruby/ruby/blob/trunk/vm.c#L12 #include "ruby/vm.h" #include "ruby/st.h" -#define vm_call0 rb_vm_call0 #define vm_exec rb_vm_exec -#define vm_invoke_bmethod rb_vm_invoke_bmethod -#define vm_search_method_slowpath rb_vm_search_method_slowpath #include "gc.h" #include "vm_core.h" @@ -302,7 +299,7 @@ static void vm_collect_usage_register(in https://github.com/ruby/ruby/blob/trunk/vm.c#L299 #endif static VALUE vm_make_env_object(const rb_execution_context_t *ec, rb_control_frame_t *cfp); -extern VALUE vm_invoke_bmethod(rb_execution_context_t *ec, rb_proc_t *proc, VALUE self, int argc, const VALUE *argv, VALUE block_handler); +extern VALUE rb_vm_invoke_bmethod(rb_execution_context_t *ec, rb_proc_t *proc, VALUE self, int argc, const VALUE *argv, VALUE block_handler); static VALUE vm_invoke_proc(rb_execution_context_t *ec, rb_proc_t *proc, VALUE self, int argc, const VALUE *argv, VALUE block_handler); static VALUE rb_block_param_proxy; @@ -1173,7 +1170,7 @@ vm_invoke_proc(rb_execution_context_t *e https://github.com/ruby/ruby/blob/trunk/vm.c#L1170 } MJIT_FUNC_EXPORTED VALUE -vm_invoke_bmethod(rb_execution_context_t *ec, rb_proc_t *proc, VALUE self, +rb_vm_invoke_bmethod(rb_execution_context_t *ec, rb_proc_t *proc, VALUE self, int argc, const VALUE *argv, VALUE block_handler) { return invoke_block_from_c_proc(ec, proc, self, argc, argv, block_handler, TRUE); @@ -1187,7 +1184,7 @@ rb_vm_invoke_proc(rb_execution_context_t https://github.com/ruby/ruby/blob/trunk/vm.c#L1184 vm_block_handler_verify(passed_block_handler); if (proc->is_from_method) { - return vm_invoke_bmethod(ec, proc, self, argc, argv, passed_block_handler); + return rb_vm_invoke_bmethod(ec, proc, self, argc, argv, passed_block_handler); } else { return vm_invoke_proc(ec, proc, self, argc, argv, passed_block_handler); Index: vm_insnhelper.c =================================================================== --- vm_insnhelper.c (revision 64034) +++ vm_insnhelper.c (revision 64035) @@ -1302,7 +1302,7 @@ vm_expandarray(VALUE *sp, VALUE ary, rb_ https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1302 static VALUE vm_call_general(rb_execution_context_t *ec, rb_control_frame_t *reg_cfp, struct rb_calling_info *calling, const struct rb_call_info *ci, struct rb_call_cache *cc); MJIT_FUNC_EXPORTED void -vm_search_method_slowpath(const struct rb_call_info *ci, struct rb_call_cache *cc, VALUE klass) +rb_vm_search_method_slowpath(const struct rb_call_info *ci, struct rb_call_cache *cc, VALUE klass) { cc->me = rb_callable_method_entry(klass, ci->mid); VM_ASSERT(callable_method_entry_p(cc->me)); @@ -1333,7 +1333,7 @@ vm_search_method(const struct rb_call_in https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1333 } RB_DEBUG_COUNTER_INC(mc_inline_miss); #endif - vm_search_method_slowpath(ci, cc, klass); + rb_vm_search_method_slowpath(ci, cc, klass); } static inline int @@ -1473,7 +1473,7 @@ rb_eql_opt(VALUE obj1, VALUE obj2) https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1473 return opt_eql_func(obj1, obj2, &ci, &cc); } -extern VALUE vm_call0(rb_execution_context_t *ec, VALUE, ID, int, const VALUE*, const rb_callable_method_entry_t *); +extern VALUE rb_vm_call0(rb_execution_context_t *ec, VALUE, ID, int, const VALUE*, const rb_callable_method_entry_t *); static VALUE check_match(rb_execution_context_t *ec, VALUE pattern, VALUE target, enum vm_check_match_type type) @@ -1490,7 +1490,7 @@ check_match(rb_execution_context_t *ec, https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1490 const rb_callable_method_entry_t *me = rb_callable_method_entry_with_refinements(CLASS_OF(pattern), idEqq, NULL); if (me) { - return vm_call0(ec, pattern, idEqq, 1, &target, me); + return rb_vm_call0(ec, pattern, idEqq, 1, &target, me); } else { /* fallback to funcall (e.g. method_missing) */ @@ -1972,7 +1972,7 @@ vm_call_bmethod_body(rb_execution_contex https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1972 /* control block frame */ ec->passed_bmethod_me = cc->me; GetProcPtr(cc->me->def->body.proc, proc); - val = vm_invoke_bmethod(ec, proc, calling->recv, calling->argc, argv, calling->block_handler); + val = rb_vm_invoke_bmethod(ec, proc, calling->recv, calling->argc, argv, calling->block_handler); return val; } Index: vm_args.c =================================================================== --- vm_args.c (revision 64034) +++ vm_args.c (revision 64035) @@ -810,7 +810,7 @@ vm_to_proc(VALUE proc) https://github.com/ruby/ruby/blob/trunk/vm_args.c#L810 rb_callable_method_entry_with_refinements(CLASS_OF(proc), idTo_proc, NULL); if (me) { - b = vm_call0(GET_EC(), proc, idTo_proc, 0, NULL, me); + b = rb_vm_call0(GET_EC(), proc, idTo_proc, 0, NULL, me); } else { /* NOTE: calling method_missing */ @@ -850,7 +850,7 @@ refine_sym_proc_call(RB_BLOCK_CALL_FUNC_ https://github.com/ruby/ruby/blob/trunk/vm_args.c#L850 if (!me) { return method_missing(obj, mid, argc, argv, MISSING_NOENTRY); } - return vm_call0(ec, obj, mid, argc, argv, me); + return rb_vm_call0(ec, obj, mid, argc, argv, me); } static void -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/