com php-src: Merge branch 'call-frame' into phpng: Zend/zend_ compile.h Zend/zend_vm_def.h Zend/zend_vm_execu te.h main/php_variables.c
| From: | Dmitry Stogov | Date: | Mon, 07 Jul 2014 12:19:24 +0000 |
| Subject: | com php-src: Merge branch 'call-frame' into phpng: Zend/zend_ compile.h Zend/zend_vm_def.h Zend/zend_vm_execu te.h main/php_variables.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-79272@lists.php.net to get a copy of this message | ||
Commit: 7ce2d59ad2e0cac525ad7419e57da68fa2160677
Author: Dmitry Stogov <dmitry@zend.com> Mon, 7 Jul 2014 16:19:24 +0400
Parents: edf2f715e691860430166d8c44793642e36192f7 5aa91be509731eb46acff242412941325122ab03
Branches: phpng
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7ce2d59ad2e0cac525ad7419e57da68fa2160677
Log:
Merge branch 'call-frame' into phpng
* call-frame:
Simplify call-frame handling
Removed EG(active_symbol_table) and use corresponding value from EG(current_execute_data)
Use values from current_execute_data instead of globals where possible
Removed EG(called_scope) and use corresponding value from EG(current_execute_data)
Removed EG(in_execution). If EG(currentent_execute_data) is not NULL we are executing something.
Removed EG(opline_ptr) and use corresponding value from EG(current_execute_data)
Removed EG(active_op_array) and use corresponding value from EG(current_execute_data)
Uinified call frame handling for user and internal functions. Now EG(current_execute_data) always
point to the call frame of the currently executed function.
Fixed cleanup of incompleytely passed parameters
Prohibited parameter redefinition
Fixed support for extra arguments in conjunction with variadiv argument. Use compile time flags to
check if we call constructor and result of ZEND_NEW is used or not.
Fixed uninitialized variables
Optimization
Changed zend_execute_data layout to reduce memory overhead
Help C compilet to do the better job optimizing target code
Use fast comparison for (func->type == ZEND_USER_FUNCTION || func->type == ZEND_EVAL_CODE)
Keep extra args in the same VM stack segment (after all CV and TMP vars)
Refactoring: merge call_frame and end_execute_data into single data structure. Keep only single
copy of each argument on VM stack (previously ZE kept two copies of each arguments for user
functions)
Refactoring: use call_frames instead of call_slots
Conflicts:
Zend/zend_vm_def.h
Zend/zend_vm_execute.h
Changed paths:
MM Zend/zend_compile.h
MM Zend/zend_vm_def.h
MM Zend/zend_vm_execute.h
MM main/php_variables.c
Diff:
diff --cc Zend/zend_vm_def.h
index 50f0e53,e654834..89668bd
--- a/Zend/zend_vm_def.h
+++ b/Zend/zend_vm_def.h
@@@ -2689,16 -2680,13 +2680,15 @@@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY
if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
if (RETURN_VALUE_USED(opline)) {
- zend_generator_create_zval(&fbc->op_array, EX_VAR(opline->result.var) TSRMLS_CC);
+ zend_generator_create_zval(call, &fbc->op_array, EX_VAR(opline->result.var)
TSRMLS_CC);
+ } else {
+ zend_vm_stack_free_args(call TSRMLS_CC);
}
- EX(call) = call->prev_nested_call;
zend_vm_stack_free_call_frame(call TSRMLS_CC);
} else {
- call->prev_execute_data = EG(current_execute_data);
- i_init_execute_data(call, &fbc->op_array, return_value, VM_FRAME_NESTED_FUNCTION
TSRMLS_CC);
+ call->prev_execute_data = execute_data;
+ i_init_func_execute_data(call, &fbc->op_array, return_value, VM_FRAME_NESTED_FUNCTION
TSRMLS_CC);
if (EXPECTED(zend_execute_ex == execute_ex)) {
ZEND_VM_ENTER();
diff --cc Zend/zend_vm_execute.h
index 31f1b9d,b069ead..dcaa165
--- a/Zend/zend_vm_execute.h
+++ b/Zend/zend_vm_execute.h
@@@ -641,16 -628,13 +628,15 @@@ static int ZEND_FASTCALL ZEND_DO_FCALL
if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
if (RETURN_VALUE_USED(opline)) {
- zend_generator_create_zval(&fbc->op_array, EX_VAR(opline->result.var) TSRMLS_CC);
+ zend_generator_create_zval(call, &fbc->op_array, EX_VAR(opline->result.var)
TSRMLS_CC);
+ } else {
+ zend_vm_stack_free_args(call TSRMLS_CC);
}
- EX(call) = call->prev_nested_call;
zend_vm_stack_free_call_frame(call TSRMLS_CC);
} else {
- call->prev_execute_data = EG(current_execute_data);
- i_init_execute_data(call, &fbc->op_array, return_value, VM_FRAME_NESTED_FUNCTION
TSRMLS_CC);
+ call->prev_execute_data = execute_data;
+ i_init_func_execute_data(call, &fbc->op_array, return_value, VM_FRAME_NESTED_FUNCTION
TSRMLS_CC);
if (EXPECTED(zend_execute_ex == execute_ex)) {
ZEND_VM_ENTER();