`th` -> `ec` for some functions.

* vm.c (rb_vm_get_binding_creatable_next_cfp): accepts `ec` instead of `th`.

* vm.c (rb_vm_stack_to_heap): ditto.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60508 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ko1 2017-10-28 10:47:19 +00:00
Родитель 9ca5088428
Коммит 5a7bd5349c
5 изменённых файлов: 13 добавлений и 13 удалений

2
cont.c
Просмотреть файл

@ -606,7 +606,7 @@ cont_capture(volatile int *volatile stat)
const rb_execution_context_t *ec = th->ec;
THREAD_MUST_BE_RUNNING(th);
rb_vm_stack_to_heap(th);
rb_vm_stack_to_heap(th->ec);
cont = cont_new(rb_cContinuation);
contval = cont->self;

2
safe.c
Просмотреть файл

@ -82,7 +82,7 @@ safe_setter(VALUE val)
}
/* block parameters */
rb_vm_stack_to_heap(th);
rb_vm_stack_to_heap(th->ec);
th->ec->safe_level = level;
}

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

@ -483,9 +483,9 @@ vm_set_main_stack(rb_execution_context_t *ec, const rb_iseq_t *iseq)
}
rb_control_frame_t *
rb_vm_get_binding_creatable_next_cfp(const rb_thread_t *th, const rb_control_frame_t *cfp)
rb_vm_get_binding_creatable_next_cfp(const rb_execution_context_t *ec, const rb_control_frame_t *cfp)
{
while (!RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(th->ec, cfp)) {
while (!RUBY_VM_CONTROL_FRAME_STACK_OVERFLOW_P(ec, cfp)) {
if (cfp->iseq) {
return (rb_control_frame_t *)cfp;
}
@ -729,11 +729,11 @@ vm_make_env_object(const rb_execution_context_t *ec, rb_control_frame_t *cfp)
}
void
rb_vm_stack_to_heap(rb_thread_t *th)
rb_vm_stack_to_heap(rb_execution_context_t *ec)
{
rb_control_frame_t *cfp = th->ec->cfp;
while ((cfp = rb_vm_get_binding_creatable_next_cfp(th, cfp)) != 0) {
vm_make_env_object(th->ec, cfp);
rb_control_frame_t *cfp = ec->cfp;
while ((cfp = rb_vm_get_binding_creatable_next_cfp(ec, cfp)) != 0) {
vm_make_env_object(ec, cfp);
cfp = RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp);
}
}
@ -895,7 +895,7 @@ rb_vm_make_proc_lambda(const rb_execution_context_t *ec, const struct rb_capture
VALUE
rb_vm_make_binding(rb_thread_t *th, const rb_control_frame_t *src_cfp)
{
rb_control_frame_t *cfp = rb_vm_get_binding_creatable_next_cfp(th, src_cfp);
rb_control_frame_t *cfp = rb_vm_get_binding_creatable_next_cfp(th->ec, src_cfp);
rb_control_frame_t *ruby_level_cfp = rb_vm_get_ruby_level_next_cfp(th->ec, src_cfp);
VALUE bindval, envval;
rb_binding_t *bind;
@ -909,7 +909,7 @@ rb_vm_make_binding(rb_thread_t *th, const rb_control_frame_t *src_cfp)
if (cfp == ruby_level_cfp) {
break;
}
cfp = rb_vm_get_binding_creatable_next_cfp(th, RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp));
cfp = rb_vm_get_binding_creatable_next_cfp(th->ec, RUBY_VM_PREVIOUS_CONTROL_FRAME(cfp));
}
bindval = rb_binding_alloc(rb_cBinding);

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

@ -1541,10 +1541,10 @@ rb_vm_living_threads_remove(rb_vm_t *vm, rb_thread_t *th)
typedef int rb_backtrace_iter_func(void *, VALUE, int, VALUE);
rb_control_frame_t *rb_vm_get_ruby_level_next_cfp(const rb_execution_context_t *ec, const rb_control_frame_t *cfp);
rb_control_frame_t *rb_vm_get_binding_creatable_next_cfp(const rb_thread_t *th, const rb_control_frame_t *cfp);
rb_control_frame_t *rb_vm_get_binding_creatable_next_cfp(const rb_execution_context_t *th, const rb_control_frame_t *cfp);
int rb_vm_get_sourceline(const rb_control_frame_t *);
VALUE rb_name_err_mesg_new(VALUE mesg, VALUE recv, VALUE method);
void rb_vm_stack_to_heap(rb_thread_t *th);
void rb_vm_stack_to_heap(rb_execution_context_t *ec);
void ruby_thread_init_stack(rb_thread_t *th);
int rb_vm_control_frame_id_and_class(const rb_control_frame_t *cfp, ID *idp, ID *called_idp, VALUE *klassp);
void rb_vm_rewind_cfp(rb_execution_context_t *ec, rb_control_frame_t *cfp);

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

@ -807,7 +807,7 @@ VALUE
rb_tracearg_binding(rb_trace_arg_t *trace_arg)
{
rb_control_frame_t *cfp;
cfp = rb_vm_get_binding_creatable_next_cfp(trace_arg->th, trace_arg->cfp);
cfp = rb_vm_get_binding_creatable_next_cfp(trace_arg->th->ec, trace_arg->cfp);
if (cfp) {
return rb_vm_make_binding(trace_arg->th, cfp);