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.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
k0kubun 2018-07-24 15:17:08 +00:00
Родитель 63f51f5283
Коммит ba8413c27c
5 изменённых файлов: 18 добавлений и 21 удалений

9
vm.c
Просмотреть файл

@ -12,10 +12,7 @@
#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(int reg, int isset);
#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 *ec, rb_proc_t *proc, VALUE self,
}
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 *ec, rb_proc_t *proc,
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);

Просмотреть файл

@ -810,7 +810,7 @@ vm_to_proc(VALUE proc)
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_ARGLIST(yielded_arg, callback_arg))
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

Просмотреть файл

@ -41,7 +41,7 @@ static VALUE vm_call0_body(rb_execution_context_t* ec, struct rb_calling_info *c
#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, struct rb_calling_info *calling, const
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, int argc, const VALUE *argv)
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,
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 mid, int argc, const VALUE *argv, VALUE
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, ID mid, int argc, const VALUE *argv,
}
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 argc, const VALUE *argv, enum method_missin
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;
}

Просмотреть файл

@ -1302,7 +1302,7 @@ vm_expandarray(VALUE *sp, VALUE ary, rb_num_t num, int flag)
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_info *ci, struct rb_call_cache *cc, VALUE
}
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)
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, VALUE pattern, VALUE target, enum vm_che
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_context_t *ec, struct rb_calling_info *calling
/* 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;
}

Просмотреть файл

@ -1913,7 +1913,7 @@ call_method_entry(rb_execution_context_t *ec, VALUE defined_class, VALUE obj, ID
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;
}