From: Dmitry Stogov Date: Mon, 22 Jun 2015 13:39:07 +0000 (+0300) Subject: Added comments X-Git-Tag: php-7.0.0alpha2~2^2~13 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=567aa1783e30570140a21f94b98bc99a4aa1241b;p=php Added comments --- diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index 0b54445323..9719eda42b 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -148,6 +148,13 @@ struct _zend_vm_stack { #define ZEND_VM_STACK_ELEMETS(stack) \ (((zval*)(stack)) + ZEND_VM_STACK_HEADER_SLOTS) +/* + * In general in RELEASE build ZEND_ASSERT() must be zero-cost, but for some + * reason, GCC generated worse code, performing CSE on assertion code and the + * following "slow path" and moving memory read operatins from slow path into + * common header. This made a degradation for the fast path. + * The following "#if ZEND_DEBUG" eliminates it. + */ #if ZEND_DEBUG # define ZEND_ASSERT_VM_STACK(stack) ZEND_ASSERT(stack->top > (zval *) stack && stack->end > (zval *) stack && stack->top <= stack->end) # define ZEND_ASSERT_VM_STACK_GLOBAL ZEND_ASSERT(EG(vm_stack_top) > (zval *) EG(vm_stack) && EG(vm_stack_end) > (zval *) EG(vm_stack) && EG(vm_stack_top) <= EG(vm_stack_end))