diff options
author | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-03 02:48:43 +0000 |
---|---|---|
committer | ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-06-03 02:48:43 +0000 |
commit | cc71f75b60fdf7908fb51bbb9a65aadb0c1e3b75 (patch) | |
tree | c4136b11a396f36f04889619c28142f85efff701 | |
parent | a4a966919d8d21838216355be7f2b0a5ad9958d3 (diff) | |
download | ruby-cc71f75b60fdf7908fb51bbb9a65aadb0c1e3b75.tar.gz |
* method.h: change fileds order to gather frequent acces fields.
* vm_insnhelper.c (vm_call_method): add LIKELY().
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50745 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | method.h | 2 | ||||
-rw-r--r-- | vm_insnhelper.c | 2 |
3 files changed, 8 insertions, 2 deletions
@@ -1,3 +1,9 @@ +Wed Jun 3 11:47:15 2015 Koichi Sasada <ko1@atdot.net> + + * method.h: change fileds order to gather frequent acces fields. + + * vm_insnhelper.c (vm_call_method): add LIKELY(). + Wed Jun 03 10:35:45 2015 Koichi Sasada <ko1@atdot.net> * method.h: split rb_method_definition_t::flag to several flags. @@ -80,8 +80,8 @@ typedef struct rb_method_alias_struct { typedef struct rb_method_definition_struct { struct { rb_method_visibility_t visi: 3; - unsigned int basic: 1; unsigned int safe: 3; + unsigned int basic: 1; } flags; rb_method_type_t type; /* method type */ diff --git a/vm_insnhelper.c b/vm_insnhelper.c index 87c9e5f739..cb89bd3566 100644 --- a/vm_insnhelper.c +++ b/vm_insnhelper.c @@ -1911,7 +1911,7 @@ vm_call_method(rb_thread_t *th, rb_control_frame_t *cfp, rb_call_info_t *ci) start_method_dispatch: if (ci->me != 0) { - if (ci->me->def->flags.visi == METHOD_VISI_PUBLIC && ci->me->def->flags.safe == 0) { + if (LIKELY(ci->me->def->flags.visi == METHOD_VISI_PUBLIC && ci->me->def->flags.safe == 0)) { VALUE klass; normal_method_dispatch: |