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

ruby-changes:40289

From: ko1 <ko1@a...>
Date: Fri, 30 Oct 2015 06:54:01 +0900 (JST)
Subject: [ruby-changes:40289] ko1:r52370 (trunk): * vm_insnhelper.c (vm_env_cref): make it inline for performance.

ko1	2015-10-30 06:47:05 +0900 (Fri, 30 Oct 2015)

  New Revision: 52370

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

  Log:
    * vm_insnhelper.c (vm_env_cref): make it inline for performance.
    
    * vm_insnhelper.c (rb_vm_get_cref): use NULL instead of 0.

  Modified files:
    trunk/ChangeLog
    trunk/vm_insnhelper.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 52369)
+++ ChangeLog	(revision 52370)
@@ -1,3 +1,9 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Fri Oct 30 06:43:50 2015  Koichi Sasada  <ko1@a...>
+
+	* vm_insnhelper.c (vm_env_cref): make it inline for performance.
+
+	* vm_insnhelper.c (rb_vm_get_cref): use NULL instead of 0.
+
 Fri Oct 30 06:20:40 2015  Koichi Sasada  <ko1@a...>
 
 	* insns.def: nobody set ic->ic_value.value to Qundef.
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 52369)
+++ vm_insnhelper.c	(revision 52370)
@@ -448,7 +448,7 @@ check_cref(VALUE obj, int can_be_svar) https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L448
     }
 }
 
-static rb_cref_t *
+static inline rb_cref_t *
 vm_env_cref(const VALUE *ep)
 {
     rb_cref_t *cref;
@@ -492,11 +492,12 @@ rb_vm_get_cref(const VALUE *ep) https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L492
 {
     rb_cref_t *cref = vm_env_cref(ep);
 
-    if (cref == 0) {
+    if (cref != NULL) {
+	return cref;
+    }
+    else {
 	rb_bug("rb_vm_get_cref: unreachable");
     }
-
-    return cref;
 }
 
 void

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

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