Skip to content

Commit 2ca2d09

Browse files
committed
Micro optimizations for the more frequently paths
1 parent e38ed4c commit 2ca2d09

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

Zend/zend_execute.c

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1803,14 +1803,12 @@ ZEND_API void zend_clean_and_cache_symbol_table(zend_array *symbol_table) /* {{{
18031803

18041804
static zend_always_inline void i_free_compiled_variables(zend_execute_data *execute_data) /* {{{ */
18051805
{
1806-
if (EXPECTED(EX(func)->op_array.last_var > 0)) {
1807-
zval *cv = EX_VAR_NUM(0);
1808-
zval *end = cv + EX(func)->op_array.last_var;
1809-
do {
1810-
zval_ptr_dtor(cv);
1811-
cv++;
1812-
} while (cv != end);
1813-
}
1806+
zval *cv = EX_VAR_NUM(0);
1807+
zval *end = cv + EX(func)->op_array.last_var;
1808+
while (EXPECTED(cv != end)) {
1809+
zval_ptr_dtor(cv);
1810+
cv++;
1811+
}
18141812
}
18151813
/* }}} */
18161814

Zend/zend_execute.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame(uint3
194194

195195
static zend_always_inline void zend_vm_stack_free_extra_args_ex(uint32_t call_info, zend_execute_data *call)
196196
{
197-
if (call_info & ZEND_CALL_FREE_EXTRA_ARGS) {
197+
if (UNEXPECTED(call_info & ZEND_CALL_FREE_EXTRA_ARGS)) {
198198
zval *end = ZEND_CALL_VAR_NUM(call, call->func->op_array.last_var + call->func->op_array.T);
199199
zval *p = end + (ZEND_CALL_NUM_ARGS(call) - call->func->op_array.num_args);
200200
do {

0 commit comments

Comments
 (0)