File tree Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Expand file tree Collapse file tree 1 file changed +7
-0
lines changed Original file line number Diff line number Diff line change @@ -148,6 +148,13 @@ struct _zend_vm_stack {
148
148
#define ZEND_VM_STACK_ELEMETS (stack ) \
149
149
(((zval*)(stack)) + ZEND_VM_STACK_HEADER_SLOTS)
150
150
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
+ */
151
158
#if ZEND_DEBUG
152
159
# define ZEND_ASSERT_VM_STACK (stack ) ZEND_ASSERT(stack->top > (zval *) stack && stack->end > (zval *) stack && stack->top <= stack->end)
153
160
# 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))
You can’t perform that action at this time.
0 commit comments