com php-src: Micro optimizations for the more frequently paths: Zend/zend_execute.c Zend/zend_execute.h
| From: | Dmitry Stogov | Date: | Thu, 16 Apr 2015 11:46:54 +0000 |
| Subject: | com php-src: Micro optimizations for the more frequently paths: Zend/zend_execute.c Zend/zend_execute.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-86326@lists.php.net to get a copy of this message | ||
Commit: 2ca2d0938bbbdb29691ce564b6521636561c75a9
Author: Dmitry Stogov <dmitry@zend.com> Thu, 16 Apr 2015 14:46:54 +0300
Parents: e38ed4c28ffe56f910626870667b374ac5ad1481
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2ca2d0938bbbdb29691ce564b6521636561c75a9
Log:
Micro optimizations for the more frequently paths
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 f60cfbf..04c33f8 100644
--- a/Zend/zend_execute.c
+++ b/Zend/zend_execute.c
@@ -1803,14 +1803,12 @@ ZEND_API void zend_clean_and_cache_symbol_table(zend_array *symbol_table) /*
{{{
static zend_always_inline void i_free_compiled_variables(zend_execute_data *execute_data) /* {{{ */
{
- if (EXPECTED(EX(func)->op_array.last_var > 0)) {
- zval *cv = EX_VAR_NUM(0);
- zval *end = cv + EX(func)->op_array.last_var;
- do {
- zval_ptr_dtor(cv);
- cv++;
- } while (cv != end);
- }
+ zval *cv = EX_VAR_NUM(0);
+ zval *end = cv + EX(func)->op_array.last_var;
+ while (EXPECTED(cv != end)) {
+ zval_ptr_dtor(cv);
+ cv++;
+ }
}
/* }}} */
diff --git a/Zend/zend_execute.h b/Zend/zend_execute.h
index f98faf9..4dfed18 100644
--- a/Zend/zend_execute.h
+++ b/Zend/zend_execute.h
@@ -194,7 +194,7 @@ static zend_always_inline zend_execute_data *zend_vm_stack_push_call_frame(uint3
static zend_always_inline void zend_vm_stack_free_extra_args_ex(uint32_t call_info,
zend_execute_data *call)
{
- if (call_info & ZEND_CALL_FREE_EXTRA_ARGS) {
+ if (UNEXPECTED(call_info & ZEND_CALL_FREE_EXTRA_ARGS)) {
zval *end = ZEND_CALL_VAR_NUM(call, call->func->op_array.last_var +
call->func->op_array.T);
zval *p = end + (ZEND_CALL_NUM_ARGS(call) - call->func->op_array.num_args);
do {