]> granicus.if.org Git - php/commitdiff
Micro optimization
authorDmitry Stogov <dmitry@zend.com>
Tue, 7 Oct 2014 19:48:55 +0000 (23:48 +0400)
committerDmitry Stogov <dmitry@zend.com>
Tue, 7 Oct 2014 19:48:55 +0000 (23:48 +0400)
Zend/zend_execute.c
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index 0c455b84d30b0316d4788595c0264935528f27d4..7348dda822bb665b5e1fcf1e83c5f3fc710b014a 100644 (file)
@@ -1427,11 +1427,11 @@ static zend_always_inline void i_init_func_execute_data(zend_execute_data *execu
 {
        uint32_t first_extra_arg, num_args;
        ZEND_ASSERT(EX(func) == (zend_function*)op_array);
+       ZEND_ASSERT(EX(scope) == EG(scope));
 
        EX(opline) = op_array->opcodes;
        EX(call) = NULL;
        EX(return_value) = return_value;
-       EX(scope) = EG(scope);
        EX(delayed_exception) = NULL;
        EX(silence_op_num) = -1;
 
@@ -1637,6 +1637,7 @@ ZEND_API zend_execute_data *zend_create_generator_execute_data(zend_execute_data
        }
 
        EX(symbol_table) = NULL;
+       EX(scope) = EG(scope);
 
        i_init_func_execute_data(execute_data, op_array, return_value TSRMLS_CC);
 
index 91036489becb59ff167204d83fbb3add7e788649..6aeac0e2d16efd852250828ed2b15b283928dd13 100644 (file)
@@ -2698,7 +2698,7 @@ ZEND_VM_HANDLER(60, ZEND_DO_FCALL, ANY, ANY)
                        ZEND_VM_C_GOTO(fcall_end);
                }
        } else if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) {
-               EG(scope) = fbc->common.scope;
+               call->scope = EG(scope) = fbc->common.scope;
                if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
                        if (RETURN_VALUE_USED(opline)) {
                                zend_generator_create_zval(call, &fbc->op_array, EX_VAR(opline->result.var) TSRMLS_CC);
index fba611a1e2f78069ae07f079ab4a5f4b79a111fb..e68cf1945c5a6f5e0e82747953f96a0841bbafe1 100644 (file)
@@ -580,7 +580,7 @@ static int ZEND_FASTCALL  ZEND_DO_FCALL_SPEC_HANDLER(ZEND_OPCODE_HANDLER_ARGS)
                        goto fcall_end;
                }
        } else if (EXPECTED(fbc->type == ZEND_USER_FUNCTION)) {
-               EG(scope) = fbc->common.scope;
+               call->scope = EG(scope) = fbc->common.scope;
                if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_GENERATOR) != 0)) {
                        if (RETURN_VALUE_USED(opline)) {
                                zend_generator_create_zval(call, &fbc->op_array, EX_VAR(opline->result.var) TSRMLS_CC);