Skip to content

Commit

Permalink
vm_insnhelper.c: reduce duplication
Browse files Browse the repository at this point in the history
* vm_insnhelper.c (vm_search_method): reduce duplicated code for the
  case cache does not hit.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42703 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information
nobu committed Aug 27, 2013
1 parent b3392da commit f01cef2
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions vm_insnhelper.c
Original file line number Diff line number Diff line change
Expand Up @@ -850,17 +850,14 @@ vm_search_method(rb_call_info_t *ci, VALUE recv)
#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
}

Expand Down

0 comments on commit f01cef2

Please sign in to comment.