mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
42d137ff19
commit
ed21061f21
3 changed files with 13 additions and 13 deletions
20
proc.c
20
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);
|
||||
}
|
||||
|
||||
/**********************************************************************
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue