[前][次][番号順一覧][スレッド一覧]

ruby-changes:38664

From: ko1 <ko1@a...>
Date: Wed, 3 Jun 2015 11:49:01 +0900 (JST)
Subject: [ruby-changes:38664] ko1:r50745 (trunk): * method.h: change fileds order to gather frequent acces fields.

ko1	2015-06-03 11:48:43 +0900 (Wed, 03 Jun 2015)

  New Revision: 50745

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=50745

  Log:
    * method.h: change fileds order to gather frequent acces fields.
    * vm_insnhelper.c (vm_call_method): add LIKELY().

  Modified files:
    trunk/ChangeLog
    trunk/method.h
    trunk/vm_insnhelper.c
Index: method.h
===================================================================
--- method.h	(revision 50744)
+++ method.h	(revision 50745)
@@ -80,8 +80,8 @@ typedef struct rb_method_alias_struct { https://github.com/ruby/ruby/blob/trunk/method.h#L80
 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 */
 
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 50744)
+++ ChangeLog	(revision 50745)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Wed Jun  3 11:47:15 2015  Koichi Sasada  <ko1@a...>
+
+	* 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@a...>
 
 	* method.h: split rb_method_definition_t::flag to several flags.
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 50744)
+++ vm_insnhelper.c	(revision 50745)
@@ -1911,7 +1911,7 @@ vm_call_method(rb_thread_t *th, rb_contr https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L1911
 
   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:

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]