com php-src: Save some unnecessary zval copying: Zend/zend_ex ecute_API.c
| From: | Xinchen Hui | Date: | Mon, 26 May 2014 09:25:57 +0000 |
| Subject: | com php-src: Save some unnecessary zval copying: Zend/zend_ex ecute_API.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-78543@lists.php.net to get a copy of this message | ||
Commit: b5f90e5103f9d0c8560b4106837eebe117403604
Author: Xinchen Hui <laruence@php.net> Mon, 26 May 2014 17:25:57 +0800
Parents: bd4b9837e9d839ea527e22d35cb7f7cf9d80d839
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=b5f90e5103f9d0c8560b4106837eebe117403604
Log:
Save some unnecessary zval copying
Changed paths:
M Zend/zend_execute_API.c
Diff:
diff --git a/Zend/zend_execute_API.c b/Zend/zend_execute_API.c
index 0a21e06..14f6a47 100644
--- a/Zend/zend_execute_API.c
+++ b/Zend/zend_execute_API.c
@@ -133,7 +133,6 @@ static int clean_non_persistent_class_full(zval *zv TSRMLS_DC) /* {{{ */
void init_executor(TSRMLS_D) /* {{{ */
{
- zval tmp;
zend_init_fpu(TSRMLS_C);
ZVAL_NULL(&EG(uninitialized_zval));
@@ -157,8 +156,7 @@ void init_executor(TSRMLS_D) /* {{{ */
EG(error_handling) = EH_NORMAL;
zend_vm_stack_init(TSRMLS_C);
- ZVAL_LONG(&tmp, 0);
- zend_vm_stack_push(&tmp TSRMLS_CC);
+ ZVAL_LONG(zend_vm_stack_top_inc(TSRMLS_C), 0);
zend_hash_init(&EG(symbol_table).ht, 64, NULL, ZVAL_PTR_DTOR, 0);
EG(active_symbol_table) = &EG(symbol_table);
@@ -507,7 +505,7 @@ ZEND_API int zend_is_true(zval *op TSRMLS_DC) /* {{{ */
ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_class_entry *scope
TSRMLS_DC) /* {{{ */
{
- zval *const_value, tmp;
+ zval *const_value;
char *colon;
if (IS_CONSTANT_VISITED(p)) {
@@ -593,6 +591,7 @@ ZEND_API int zval_update_constant_ex(zval *p, zend_bool inline_change, zend_clas
if (Z_REFCOUNTED_P(p)) Z_SET_REFCOUNT_P(p, refcount);
} else if (Z_TYPE_P(p) == IS_CONSTANT_AST) {
+ zval tmp;
SEPARATE_ZVAL_IF_NOT_REF(p);
zend_ast_evaluate(&tmp, Z_ASTVAL_P(p), scope TSRMLS_CC);
@@ -810,9 +809,8 @@ int zend_call_function(zend_fcall_info *fci, zend_fcall_info_cache *fci_cache TS
zend_vm_stack_push(param TSRMLS_CC);
}
- EX(function_state).arguments = zend_vm_stack_top(TSRMLS_C);
- ZVAL_LONG(&tmp, fci->param_count);
- zend_vm_stack_push(&tmp TSRMLS_CC);
+ EX(function_state).arguments = zend_vm_stack_top_inc(TSRMLS_C);
+ ZVAL_LONG(EX(function_state).arguments, fci->param_count);
EG(scope) = calling_scope;
EG(called_scope) = called_scope;