ruby-changes:48356
From: ko1 <ko1@a...>
Date: Fri, 27 Oct 2017 14:19:03 +0900 (JST)
Subject: [ruby-changes:48356] ko1:r60470 (trunk): vm_get_ev_const() accepts `ec` instead of `th`.
ko1 2017-10-27 14:18:58 +0900 (Fri, 27 Oct 2017) New Revision: 60470 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=60470 Log: vm_get_ev_const() accepts `ec` instead of `th`. * vm_insnhelper.c (vm_get_ev_const): accepts `ec` instead of `th`. Modified files: trunk/insns.def trunk/vm_insnhelper.c Index: vm_insnhelper.c =================================================================== --- vm_insnhelper.c (revision 60469) +++ vm_insnhelper.c (revision 60470) @@ -808,14 +808,14 @@ vm_get_iclass(rb_control_frame_t *cfp, V https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L808 } static inline VALUE -vm_get_ev_const(rb_thread_t *th, VALUE orig_klass, ID id, int is_defined) +vm_get_ev_const(rb_execution_context_t *ec, VALUE orig_klass, ID id, int is_defined) { void rb_const_warn_if_deprecated(const rb_const_entry_t *ce, VALUE klass, ID id); VALUE val; if (orig_klass == Qnil) { /* in current lexical scope */ - const rb_cref_t *root_cref = rb_vm_get_cref(th->ec->cfp->ep); + const rb_cref_t *root_cref = rb_vm_get_cref(ec->cfp->ep); const rb_cref_t *cref; VALUE klass = Qnil; @@ -861,10 +861,10 @@ vm_get_ev_const(rb_thread_t *th, VALUE o https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L861 /* search self */ if (root_cref && !NIL_P(CREF_CLASS(root_cref))) { - klass = vm_get_iclass(th->ec->cfp, CREF_CLASS(root_cref)); + klass = vm_get_iclass(ec->cfp, CREF_CLASS(root_cref)); } else { - klass = CLASS_OF(th->ec->cfp->self); + klass = CLASS_OF(ec->cfp->self); } if (is_defined) { @@ -2849,7 +2849,7 @@ vm_defined(rb_thread_t *th, rb_control_f https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2849 } case DEFINED_CONST: klass = v; - if (vm_get_ev_const(th, klass, SYM2ID(obj), 1)) { + if (vm_get_ev_const(th->ec, klass, SYM2ID(obj), 1)) { expr_type = DEFINED_CONST; } break; Index: insns.def =================================================================== --- insns.def (revision 60469) +++ insns.def (revision 60470) @@ -230,7 +230,7 @@ getconstant https://github.com/ruby/ruby/blob/trunk/insns.def#L230 (VALUE klass) (VALUE val) { - val = vm_get_ev_const(th, klass, id, 0); + val = vm_get_ev_const(th->ec, klass, id, 0); } /** -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/