ruby-changes:30624
From: nobu <ko1@a...>
Date: Tue, 27 Aug 2013 16:11:53 +0900 (JST)
Subject: [ruby-changes:30624] nobu:r42703 (trunk): vm_insnhelper.c: reduce duplication
nobu 2013-08-27 16:11:49 +0900 (Tue, 27 Aug 2013) New Revision: 42703 http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=42703 Log: vm_insnhelper.c: reduce duplication * vm_insnhelper.c (vm_search_method): reduce duplicated code for the case cache does not hit. Modified files: trunk/vm_insnhelper.c Index: vm_insnhelper.c =================================================================== --- vm_insnhelper.c (revision 42702) +++ vm_insnhelper.c (revision 42703) @@ -850,17 +850,14 @@ vm_search_method(rb_call_info_t *ci, VAL https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L850 #if OPT_INLINE_METHOD_CACHE if (LIKELY(GET_VM_STATE_VERSION() == ci->vmstat && klass == ci->klass)) { /* cache hit! */ + return; } - else { - ci->me = rb_method_entry(klass, ci->mid, &ci->defined_class); - ci->klass = klass; - ci->vmstat = GET_VM_STATE_VERSION(); - ci->call = vm_call_general; - } -#else +#endif ci->me = rb_method_entry(klass, ci->mid, &ci->defined_class); ci->call = vm_call_general; ci->klass = klass; +#if OPT_INLINE_METHOD_CACHE + ci->vmstat = GET_VM_STATE_VERSION(); #endif } -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/