com php-src: Small call/return improvement: Zend/zend_execute .c Zend/zend_execute.h

From: Date: Mon, 16 Jun 2014 09:25:23 +0000
Subject: com php-src: Small call/return improvement: Zend/zend_execute .c Zend/zend_execute.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-78913@lists.php.net to get a copy of this message
Commit: e1817984055545e32ee59d22c1d5d00517caa935 Author: Dmitry Stogov <dmitry@zend.com> Mon, 16 Jun 2014 13:25:23 +0400 Parents: 3b2fb7abc5056b65459aad6ca53baa42f84a6349 Branches: phpng Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=e1817984055545e32ee59d22c1d5d00517caa935 Log: Small call/return improvement Changed paths: M Zend/zend_execute.c M Zend/zend_execute.h Diff: diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index de52545...2044557 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -1495,12 +1495,14 @@ void zend_clean_and_cache_symbol_table(zend_array *symbol_table TSRMLS_DC) /* {{ static zend_always_inline void i_free_compiled_variables(zend_execute_data *execute_data TSRMLS_DC) /* {{{ */ { - zval *cv = EX_VAR_NUM(0); - zval *end = cv + EX(op_array)->last_var; - while (cv != end) { - zval_ptr_dtor(cv); - cv++; - } + if (EXPECTED(EX(op_array)->last_var > 0)) { + zval *cv = EX_VAR_NUM(0); + zval *end = cv + EX(op_array)->last_var; + do { + zval_ptr_dtor(cv); + cv++; + } while (cv != end); + } } /* }}} */ diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h index 623d3a8..1b74564 100644 --- a/Zend/zend_execute.h +++ b/Zend/zend_execute.h @@ -253,11 +253,14 @@ static zend_always_inline void zend_vm_stack_free(void *ptr TSRMLS_DC) static zend_always_inline void zend_vm_stack_clear_multiple(int nested TSRMLS_DC) { zval *p = EG(argument_stack)->top - 1; - zval *end = p - Z_LVAL_P(p); - while (p != end) { - p--; - i_zval_ptr_dtor_nogc(p ZEND_FILE_LINE_CC TSRMLS_CC); + if (EXPECTED(Z_LVAL_P(p) > 0)) { + zval *end = p - Z_LVAL_P(p); + + do { + p--; + i_zval_ptr_dtor_nogc(p ZEND_FILE_LINE_CC TSRMLS_CC); + } while (p != end); } if (nested) { EG(argument_stack)->top = p;

« previous php.cvs (#78913) next »