thread.c: gather common statements
* thread.c (vm_check_ints_blocking): gather common statements at the end, and prefer LIKELY for Visual C optimization. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51293 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
1998039ea4
commit
22f75c300d
@ -1,3 +1,8 @@
|
|||||||
|
Sat Jul 18 21:29:19 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
|
* 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@ruby-lang.org>
|
Sat Jul 18 20:44:56 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||||
|
|
||||||
* load.c (rb_load_internal0): do not raise any exceptions but
|
* load.c (rb_load_internal0): do not raise any exceptions but
|
||||||
|
10
thread.c
10
thread.c
@ -168,15 +168,15 @@ static inline void blocking_region_end(rb_thread_t *th, struct rb_blocking_regio
|
|||||||
static inline void
|
static inline void
|
||||||
vm_check_ints_blocking(rb_thread_t *th)
|
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;
|
th->pending_interrupt_queue_checked = 0;
|
||||||
|
|
||||||
RUBY_VM_SET_INTERRUPT(th);
|
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
|
#if THREAD_DEBUG
|
||||||
|
Loading…
x
Reference in New Issue
Block a user