]> granicus.if.org Git - php/commitdiff
Merge branch 'call-frame' into phpng
authorDmitry Stogov <dmitry@zend.com>
Mon, 7 Jul 2014 12:19:24 +0000 (16:19 +0400)
committerDmitry Stogov <dmitry@zend.com>
Mon, 7 Jul 2014 12:19:24 +0000 (16:19 +0400)
* 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

1  2 
Zend/zend_compile.h
Zend/zend_vm_def.h
Zend/zend_vm_execute.h
main/php_variables.c

Simple merge
index 50f0e53e14fc5a807e92ae3c47bfd98040bfeb86,e65483468e22350afd8d88479bf75b4ef45f30ab..89668bd3b57bac210c73a7571f2d2f916d5fc240
@@@ -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();
index 31f1b9d4ae3e1ef9167c9bebd8ae75f2213d438f,b069ead63fe7b931a3c4de30e7c3d2eb5bf5c75d..dcaa1657c69f6bbc48d4b5f1619faeaaf738813e
@@@ -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();
Simple merge