From ed21061f21392b45a101d2ab6b859d7a08899c8c Mon Sep 17 00:00:00 2001 From: ko1 Date: Sat, 28 Oct 2017 11:52:56 +0000 Subject: `th` -> `ec` for rb_vm_call() * vm_eval.c (rb_vm_call): accepts `ec` instead of `th`. * proc.c: catch up this fix. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60520 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- proc.c | 20 ++++++++++---------- vm_core.h | 2 +- vm_eval.c | 4 ++-- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/proc.c b/proc.c index 29a42fcbd6..164b8bf570 100644 --- a/proc.c +++ b/proc.c @@ -2096,32 +2096,32 @@ method_callable_method_entry(const struct METHOD *data) } static inline VALUE -call_method_data(rb_thread_t *th, const struct METHOD *data, +call_method_data(rb_execution_context_t *ec, const struct METHOD *data, int argc, const VALUE *argv, VALUE passed_procval) { - vm_passed_block_handler_set(th->ec, proc_to_block_handler(passed_procval)); - return rb_vm_call(th, data->recv, data->me->called_id, argc, argv, + vm_passed_block_handler_set(ec, proc_to_block_handler(passed_procval)); + return rb_vm_call(ec, data->recv, data->me->called_id, argc, argv, method_callable_method_entry(data)); } static VALUE -call_method_data_safe(rb_thread_t *th, const struct METHOD *data, +call_method_data_safe(rb_execution_context_t *ec, const struct METHOD *data, int argc, const VALUE *argv, VALUE passed_procval, int safe) { VALUE result = Qnil; /* OK */ enum ruby_tag_type state; - EC_PUSH_TAG(th->ec); + EC_PUSH_TAG(ec); if ((state = EC_EXEC_TAG()) == TAG_NONE) { /* result is used only if state == 0, no exceptions is caught. */ /* otherwise it doesn't matter even if clobbered. */ - NO_CLOBBERED(result) = call_method_data(th, data, argc, argv, passed_procval); + NO_CLOBBERED(result) = call_method_data(ec, data, argc, argv, passed_procval); } EC_POP_TAG(); rb_set_safe_level_force(safe); if (state) - EC_JUMP_TAG(th->ec, state); + EC_JUMP_TAG(ec, state); return result; } @@ -2129,7 +2129,7 @@ VALUE rb_method_call_with_block(int argc, const VALUE *argv, VALUE method, VALUE passed_procval) { const struct METHOD *data; - rb_thread_t *const th = GET_THREAD(); + rb_execution_context_t *ec = GET_EC(); TypedData_Get_Struct(method, struct METHOD, &method_data_type, data); if (data->recv == Qundef) { @@ -2140,10 +2140,10 @@ rb_method_call_with_block(int argc, const VALUE *argv, VALUE method, VALUE passe int safe = rb_safe_level(); if (safe < safe_level_to_run) { rb_set_safe_level_force(safe_level_to_run); - return call_method_data_safe(th, data, argc, argv, passed_procval, safe); + return call_method_data_safe(ec, data, argc, argv, passed_procval, safe); } } - return call_method_data(th, data, argc, argv, passed_procval); + return call_method_data(ec, data, argc, argv, passed_procval); } /********************************************************************** diff --git a/vm_core.h b/vm_core.h index 0decbf24cc..512b729e2f 100644 --- a/vm_core.h +++ b/vm_core.h @@ -1508,7 +1508,7 @@ const rb_env_t *rb_vm_env_prev_env(const rb_env_t *env); const VALUE *rb_binding_add_dynavars(VALUE bindval, rb_binding_t *bind, int dyncount, const ID *dynvars); void rb_vm_inc_const_missing_count(void); void rb_vm_gvl_destroy(rb_vm_t *vm); -VALUE rb_vm_call(rb_thread_t *th, VALUE recv, VALUE id, int argc, +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); void rb_vm_pop_frame(rb_execution_context_t *ec); diff --git a/vm_eval.c b/vm_eval.c index 48b20d777f..403d4f8f95 100644 --- a/vm_eval.c +++ b/vm_eval.c @@ -202,9 +202,9 @@ vm_call0_body(rb_execution_context_t *ec, struct rb_calling_info *calling, const } VALUE -rb_vm_call(rb_thread_t *th, VALUE recv, VALUE id, int argc, const VALUE *argv, const rb_callable_method_entry_t *me) +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(th->ec, recv, id, argc, argv, me); + return vm_call0(ec, recv, id, argc, argv, me); } static inline VALUE -- cgit v1.2.3