Skip to content

Commit 567aa17

Browse files
committed
Added comments
1 parent 4807b16 commit 567aa17

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Zend/zend_execute.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,13 @@ struct _zend_vm_stack {
148148
#define ZEND_VM_STACK_ELEMETS(stack) \
149149
(((zval*)(stack)) + ZEND_VM_STACK_HEADER_SLOTS)
150150

151+
/*
152+
* In general in RELEASE build ZEND_ASSERT() must be zero-cost, but for some
153+
* reason, GCC generated worse code, performing CSE on assertion code and the
154+
* following "slow path" and moving memory read operatins from slow path into
155+
* common header. This made a degradation for the fast path.
156+
* The following "#if ZEND_DEBUG" eliminates it.
157+
*/
151158
#if ZEND_DEBUG
152159
# define ZEND_ASSERT_VM_STACK(stack) ZEND_ASSERT(stack->top > (zval *) stack && stack->end > (zval *) stack && stack->top <= stack->end)
153160
# 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))

0 commit comments

Comments
 (0)