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

ruby-changes:39959

From: nobu <ko1@a...>
Date: Mon, 5 Oct 2015 16:10:30 +0900 (JST)
Subject: [ruby-changes:39959] nobu:r52040 (trunk): vm_core.h: vm_thread_with_frame

nobu	2015-10-05 16:10:25 +0900 (Mon, 05 Oct 2015)

  New Revision: 52040

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

  Log:
    vm_core.h: vm_thread_with_frame
    
    * vm_core.h (vm_thread_with_frame): skip function call in
      GET_THREAD which is empty unless OPT_CALL_CFUNC_WITHOUT_FRAME is
      enabled.

  Modified files:
    trunk/vm_core.h
Index: vm_core.h
===================================================================
--- vm_core.h	(revision 52039)
+++ vm_core.h	(revision 52040)
@@ -1061,18 +1061,20 @@ extern rb_event_flag_t ruby_vm_event_fla https://github.com/ruby/ruby/blob/trunk/vm_core.h#L1061
 #define OPT_CALL_CFUNC_WITHOUT_FRAME 0
 #endif
 
+#define GET_THREAD() vm_thread_with_frame(ruby_current_thread)
+#if OPT_CALL_CFUNC_WITHOUT_FRAME
 static inline rb_thread_t *
-GET_THREAD(void)
+vm_thread_with_frame(rb_thread_t *th)
 {
-    rb_thread_t *th = ruby_current_thread;
-#if OPT_CALL_CFUNC_WITHOUT_FRAME
     if (UNLIKELY(th->passed_ci != 0)) {
 	void rb_vm_call_cfunc_push_frame(rb_thread_t *th);
 	rb_vm_call_cfunc_push_frame(th);
     }
-#endif
     return th;
 }
+#else
+#define vm_thread_with_frame(th) (th)
+#endif
 
 #define rb_thread_set_current_raw(th) (void)(ruby_current_thread = (th))
 #define rb_thread_set_current(th) do { \

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

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