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

ruby-changes:39212

From: nobu <ko1@a...>
Date: Sat, 18 Jul 2015 21:29:38 +0900 (JST)
Subject: [ruby-changes:39212] nobu:r51293 (trunk): thread.c: gather common statements

nobu	2015-07-18 21:29:21 +0900 (Sat, 18 Jul 2015)

  New Revision: 51293

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

  Log:
    thread.c: gather common statements
    
    * thread.c (vm_check_ints_blocking): gather common statements at
      the end, and prefer LIKELY for Visual C optimization.

  Modified files:
    trunk/ChangeLog
    trunk/thread.c
Index: ChangeLog
===================================================================
--- ChangeLog	(revision 51292)
+++ ChangeLog	(revision 51293)
@@ -1,3 +1,8 @@ https://github.com/ruby/ruby/blob/trunk/ChangeLog#L1
+Sat Jul 18 21:29:19 2015  Nobuyoshi Nakada  <nobu@r...>
+
+	* thread.c (vm_check_ints_blocking): gather common statements at
+	  the end, and prefer LIKELY for Visual C optimization.
+
 Sat Jul 18 20:44:56 2015  Nobuyoshi Nakada  <nobu@r...>
 
 	* load.c (rb_load_internal0): do not raise any exceptions but
Index: thread.c
===================================================================
--- thread.c	(revision 51292)
+++ thread.c	(revision 51293)
@@ -168,15 +168,15 @@ static inline void blocking_region_end(r https://github.com/ruby/ruby/blob/trunk/thread.c#L168
 static inline void
 vm_check_ints_blocking(rb_thread_t *th)
 {
-    if (UNLIKELY(!rb_threadptr_pending_interrupt_empty_p(th))) {
+    if (LIKELY(rb_threadptr_pending_interrupt_empty_p(th))) {
+	if (LIKELY(!RUBY_VM_INTERRUPTED_ANY(th))) return;
+    }
+    else {
 	th->pending_interrupt_queue_checked = 0;
 
 	RUBY_VM_SET_INTERRUPT(th);
-	rb_threadptr_execute_interrupts(th, 1);
-    }
-    else if (UNLIKELY(RUBY_VM_INTERRUPTED_ANY(th))) {
-	rb_threadptr_execute_interrupts(th, 1);
     }
+    rb_threadptr_execute_interrupts(th, 1);
 }
 
 #if THREAD_DEBUG

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

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