ruby-changes:38666
From: ko1 <ko1@a...>
Date: Wed, 3 Jun 2015 19:42:38 +0900 (JST)
Subject: [ruby-changes:38666] ko1:r50747 (trunk): * vm_core.h: rename enum missing_reason to enum method_missing_reason.
ko1 2015-06-03 19:42:18 +0900 (Wed, 03 Jun 2015) New Revision: 50747 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50747 Log: * vm_core.h: rename enum missing_reason to enum method_missing_reason. * vm_core.h: use enum method_missing_reason for rb_thread_t::method_missing_reason. * vm_eval.c: catch up this fix. * vm_insnhelper.c: ditto. Modified files: trunk/ChangeLog trunk/vm_core.h trunk/vm_eval.c trunk/vm_insnhelper.c Index: ChangeLog =================================================================== --- ChangeLog (revision 50746) +++ ChangeLog (revision 50747) @@ -1,3 +1,14 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1 +Wed Jun 3 19:24:12 2015 Koichi Sasada <ko1@a...> + + * vm_core.h: rename enum missing_reason to enum method_missing_reason. + + * vm_core.h: use enum method_missing_reason for + rb_thread_t::method_missing_reason. + + * vm_eval.c: catch up this fix. + + * vm_insnhelper.c: ditto. + Wed Jun 3 16:17:21 2015 Aaron Patterson <tenderlove@r...> * vm.c: eagerly allocate `loading_table`. This eliminates the need to Index: vm_core.h =================================================================== --- vm_core.h (revision 50746) +++ vm_core.h (revision 50747) @@ -141,6 +141,16 @@ typedef struct rb_call_info_kw_arg_struc https://github.com/ruby/ruby/blob/trunk/vm_core.h#L141 VALUE keywords[1]; } rb_call_info_kw_arg_t; +enum method_missing_reason { + MISSING_NOENTRY = 0x00, + MISSING_PRIVATE = 0x01, + MISSING_PROTECTED = 0x02, + MISSING_VCALL = 0x04, + MISSING_SUPER = 0x08, + MISSING_MISSING = 0x10, + MISSING_NONE = 0x20 +}; + /* rb_call_info_t contains calling information including inline cache */ typedef struct rb_call_info_struct { /* fixed at compile time */ @@ -167,15 +177,7 @@ typedef struct rb_call_info_struct { https://github.com/ruby/ruby/blob/trunk/vm_core.h#L177 union { int opt_pc; /* used by iseq */ int index; /* used by ivar */ - enum missing_reason { - MISSING_NOENTRY = 0x00, - MISSING_PRIVATE = 0x01, - MISSING_PROTECTED = 0x02, - MISSING_VCALL = 0x04, - MISSING_SUPER = 0x08, - MISSING_MISSING = 0x10, - MISSING_NONE = 0x20 - } missing_reason; /* used by method_missing */ + enum method_missing_reason method_missing_reason; /* used by method_missing */ int inc_sp; /* used by cfunc */ } aux; @@ -721,7 +723,7 @@ typedef struct rb_thread_struct { https://github.com/ruby/ruby/blob/trunk/vm_core.h#L723 rb_ensure_list_t *ensure_list; /* misc */ - int method_missing_reason; + enum method_missing_reason method_missing_reason; int abort_on_exception; #ifdef USE_SIGALTSTACK void *altstack; Index: vm_eval.c =================================================================== --- vm_eval.c (revision 50746) +++ vm_eval.c (revision 50747) @@ -15,7 +15,7 @@ struct local_var_list { https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L15 VALUE tbl; }; -static inline VALUE method_missing(VALUE obj, ID id, int argc, const VALUE *argv, enum missing_reason call_status); +static inline VALUE method_missing(VALUE obj, ID id, int argc, const VALUE *argv, enum method_missing_reason call_status); static inline VALUE vm_yield_with_cref(rb_thread_t *th, int argc, const VALUE *argv, const rb_cref_t *cref); static inline VALUE vm_yield(rb_thread_t *th, int argc, const VALUE *argv); static inline VALUE vm_yield_with_block(rb_thread_t *th, int argc, const VALUE *argv, const rb_block_t *blockargptr); @@ -208,7 +208,7 @@ vm_call0_body(rb_thread_t* th, rb_call_i https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L208 ci->defined_class = RCLASS_SUPER(ci->defined_class); if (!ci->defined_class || !(ci->me = rb_method_entry(ci->defined_class, ci->mid, &ci->defined_class))) { - enum missing_reason ex = (type == VM_METHOD_TYPE_ZSUPER) ? MISSING_SUPER : 0; + enum method_missing_reason ex = (type == VM_METHOD_TYPE_ZSUPER) ? MISSING_SUPER : 0; ret = method_missing(ci->recv, ci->mid, ci->argc, argv, ex); goto success; } @@ -321,7 +321,7 @@ stack_check(void) https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L321 static inline rb_method_entry_t * rb_search_method_entry(VALUE recv, ID mid, VALUE *defined_class_ptr); -static inline enum missing_reason rb_method_call_status(rb_thread_t *th, const rb_method_entry_t *me, call_type scope, VALUE self); +static inline enum method_missing_reason rb_method_call_status(rb_thread_t *th, const rb_method_entry_t *me, call_type scope, VALUE self); /*! * \internal @@ -346,7 +346,7 @@ rb_call0(VALUE recv, ID mid, int argc, c https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L346 rb_method_entry_t *me = rb_search_method_entry(recv, mid, &defined_class); rb_thread_t *th = GET_THREAD(); - enum missing_reason call_status = rb_method_call_status(th, me, scope, self); + enum method_missing_reason call_status = rb_method_call_status(th, me, scope, self); if (call_status != MISSING_NONE) { return method_missing(recv, mid, argc, argv, call_status); @@ -426,7 +426,7 @@ check_funcall_missing(rb_thread_t *th, V https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L426 else { struct rescue_funcall_args args; - th->method_missing_reason = 0; + th->method_missing_reason = MISSING_NOENTRY; args.recv = recv; args.mid = mid; args.argc = argc; @@ -556,7 +556,7 @@ rb_search_method_entry(VALUE recv, ID mi https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L556 return rb_method_entry(klass, mid, defined_class_ptr); } -static inline enum missing_reason +static inline enum method_missing_reason rb_method_call_status(rb_thread_t *th, const rb_method_entry_t *me, call_type scope, VALUE self) { VALUE klass; @@ -624,7 +624,7 @@ rb_call(VALUE recv, ID mid, int argc, co https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L624 } NORETURN(static void raise_method_missing(rb_thread_t *th, int argc, const VALUE *argv, - VALUE obj, enum missing_reason call_status)); + VALUE obj, enum method_missing_reason call_status)); /* * call-seq: @@ -693,7 +693,7 @@ make_no_method_exception(VALUE exc, cons https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L693 static void raise_method_missing(rb_thread_t *th, int argc, const VALUE *argv, VALUE obj, - enum missing_reason last_call_status) + enum method_missing_reason last_call_status) { VALUE exc = rb_eNoMethodError; const char *format = 0; @@ -728,7 +728,7 @@ raise_method_missing(rb_thread_t *th, in https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L728 } static inline VALUE -method_missing(VALUE obj, ID id, int argc, const VALUE *argv, enum missing_reason call_status) +method_missing(VALUE obj, ID id, int argc, const VALUE *argv, enum method_missing_reason call_status) { VALUE *nargv, result, work; rb_thread_t *th = GET_THREAD(); Index: vm_insnhelper.c =================================================================== --- vm_insnhelper.c (revision 50746) +++ vm_insnhelper.c (revision 50747) @@ -1740,10 +1740,10 @@ vm_call_bmethod(rb_thread_t *th, rb_cont https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1740 return vm_call_bmethod_body(th, ci, argv); } -static enum missing_reason +static enum method_missing_reason ci_missing_reason(const rb_call_info_t *ci) { - enum missing_reason stat = MISSING_NOENTRY; + enum method_missing_reason stat = MISSING_NOENTRY; if (ci->flag & VM_CALL_VCALL) stat |= MISSING_VCALL; if (ci->flag & VM_CALL_SUPER) stat |= MISSING_SUPER; return stat; @@ -1785,7 +1785,7 @@ vm_call_opt_send(rb_thread_t *th, rb_con https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1785 } TOPN(i) = rb_str_intern(sym); ci->mid = idMethodMissing; - th->method_missing_reason = ci->aux.missing_reason = ci_missing_reason(ci); + th->method_missing_reason = ci->aux.method_missing_reason = ci_missing_reason(ci); } else { /* shift arguments */ @@ -1844,7 +1844,7 @@ vm_call_method_missing(rb_thread_t *th, https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1844 argv[0] = ID2SYM(ci->mid); INC_SP(1); - th->method_missing_reason = ci->aux.missing_reason; + th->method_missing_reason = ci->aux.method_missing_reason; return vm_call_method(th, reg_cfp, &ci_entry); } @@ -1939,7 +1939,7 @@ vm_call_method(rb_thread_t *th, rb_contr https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1939 return vm_call_ivar(th, cfp, ci); } case VM_METHOD_TYPE_MISSING:{ - ci->aux.missing_reason = 0; + ci->aux.method_missing_reason = 0; CI_SET_FASTPATH(ci, vm_call_method_missing, enable_fastpath); return vm_call_method_missing(th, cfp, ci); } @@ -2040,18 +2040,18 @@ vm_call_method(rb_thread_t *th, rb_contr https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2040 else { int safe; if (!(ci->flag & VM_CALL_FCALL) && (ci->me->def->flags.visi == METHOD_VISI_PRIVATE)) { - enum missing_reason stat = MISSING_PRIVATE; + enum method_missing_reason stat = MISSING_PRIVATE; bp(); if (ci->flag & VM_CALL_VCALL) stat |= MISSING_VCALL; - ci->aux.missing_reason = stat; + ci->aux.method_missing_reason = stat; CI_SET_FASTPATH(ci, vm_call_method_missing, 1); return vm_call_method_missing(th, cfp, ci); } else if (!(ci->flag & VM_CALL_OPT_SEND) && (ci->me->def->flags.visi == METHOD_VISI_PROTECTED)) { enable_fastpath = 0; if (!rb_obj_is_kind_of(cfp->self, ci->defined_class)) { - ci->aux.missing_reason = MISSING_PROTECTED; + ci->aux.method_missing_reason = MISSING_PROTECTED; return vm_call_method_missing(th, cfp, ci); } else { @@ -2075,7 +2075,7 @@ vm_call_method(rb_thread_t *th, rb_contr https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2075 rb_raise_method_missing(th, ci->argc, argv, ci->recv, stat); } else { - ci->aux.missing_reason = stat; + ci->aux.method_missing_reason = stat; CI_SET_FASTPATH(ci, vm_call_method_missing, 1); return vm_call_method_missing(th, cfp, ci); } @@ -2211,7 +2211,7 @@ vm_search_super_method(rb_thread_t *th, https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2211 } if (!ci->klass) { /* bound instance method of module */ - ci->aux.missing_reason = MISSING_SUPER; + ci->aux.method_missing_reason = MISSING_SUPER; CI_SET_FASTPATH(ci, vm_call_method_missing, 1); return; } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/