ruby-changes:37437
From: nobu <ko1@a...>
Date: Fri, 6 Feb 2015 11:33:43 +0900 (JST)
Subject: [ruby-changes:37437] nobu:r49518 (trunk): vm_eval.c: no use of SYM2ID
nobu 2015-02-06 11:33:38 +0900 (Fri, 06 Feb 2015) New Revision: 49518 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=49518 Log: vm_eval.c: no use of SYM2ID * vm_eval.c (check_funcall_missing): no longer turn an ID into a symbol temporarily to get rid of use of SYM2ID. Modified files: trunk/vm_eval.c Index: vm_eval.c =================================================================== --- vm_eval.c (revision 49517) +++ vm_eval.c (revision 49518) @@ -350,7 +350,7 @@ rb_call0(VALUE recv, ID mid, int argc, c https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L350 struct rescue_funcall_args { VALUE recv; - VALUE sym; + ID mid; int argc; const VALUE *argv; }; @@ -361,7 +361,7 @@ check_funcall_exec(struct rescue_funcall https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L361 VALUE new_args = rb_ary_new4(args->argc, args->argv); VALUE ret; - rb_ary_unshift(new_args, args->sym); + rb_ary_unshift(new_args, ID2SYM(args->mid)); ret = rb_funcall2(args->recv, idMethodMissing, args->argc+1, RARRAY_CONST_PTR(new_args)); RB_GC_GUARD(new_args); @@ -371,7 +371,7 @@ check_funcall_exec(struct rescue_funcall https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L371 static VALUE check_funcall_failed(struct rescue_funcall_args *args, VALUE e) { - if (rb_respond_to(args->recv, SYM2ID(args->sym))) { + if (rb_respond_to(args->recv, args->mid)) { rb_exc_raise(e); } return Qundef; @@ -421,7 +421,7 @@ check_funcall_missing(rb_thread_t *th, V https://github.com/ruby/ruby/blob/trunk/vm_eval.c#L421 th->method_missing_reason = 0; args.recv = recv; - args.sym = ID2SYM(mid); + args.mid = mid; args.argc = argc; args.argv = argv; return rb_rescue2(check_funcall_exec, (VALUE)&args, -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/