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

ruby-changes:52524

From: k0kubun <ko1@a...>
Date: Thu, 13 Sep 2018 21:30:03 +0900 (JST)
Subject: [ruby-changes:52524] k0kubun:r64735 (trunk): vm_insnhelper.h: drop OPT_CALL_FASTPATH macro support

k0kubun	2018-09-13 21:29:57 +0900 (Thu, 13 Sep 2018)

  New Revision: 64735

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

  Log:
    vm_insnhelper.h: drop OPT_CALL_FASTPATH macro support
    
    because cc->call is NULL by default and it is not overridden by
    vm_search_super_method if OPT_CALL_FASTPATH is 0. So this macro is not
    just a switch for optimization but now it's mandatory.
    
    vm_insnhelper.c: cosmetic change. Use boolean-ish `TRUE` instead of 1 to
    specify `enabled` flag.

  Modified files:
    trunk/vm_insnhelper.c
    trunk/vm_insnhelper.h
Index: vm_insnhelper.c
===================================================================
--- vm_insnhelper.c	(revision 64734)
+++ vm_insnhelper.c	(revision 64735)
@@ -2511,12 +2511,12 @@ vm_search_super_method(const rb_executio https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.c#L2511
     if (!klass) {
 	/* bound instance method of module */
 	cc->aux.method_missing_reason = MISSING_SUPER;
-	CI_SET_FASTPATH(cc, vm_call_method_missing, 1);
+        CI_SET_FASTPATH(cc, vm_call_method_missing, TRUE);
     }
     else {
 	/* TODO: use inline cache */
 	cc->me = rb_callable_method_entry(klass, ci->mid);
-	CI_SET_FASTPATH(cc, vm_call_super_method, 1);
+        CI_SET_FASTPATH(cc, vm_call_super_method, TRUE);
     }
 }
 
Index: vm_insnhelper.h
===================================================================
--- vm_insnhelper.h	(revision 64734)
+++ vm_insnhelper.h	(revision 64735)
@@ -178,17 +178,9 @@ enum vm_regan_acttype { https://github.com/ruby/ruby/blob/trunk/vm_insnhelper.h#L178
  * because inline method cache does not care about receiver.
  */
 
-#ifndef OPT_CALL_FASTPATH
-#define OPT_CALL_FASTPATH 1
-#endif
-
-#if OPT_CALL_FASTPATH
 #define CI_SET_FASTPATH(cc, func, enabled) do { \
     if (LIKELY(enabled)) ((cc)->call = (func)); \
 } while (0)
-#else
-#define CI_SET_FASTPATH(ci, func, enabled) /* do nothing */
-#endif
 
 #define GET_BLOCK_HANDLER() (GET_LEP()[VM_ENV_DATA_INDEX_SPECVAL])
 

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

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