From: Dmitry Stogov Date: Tue, 7 Oct 2014 19:48:55 +0000 (+0400) Subject: Micro optimization X-Git-Tag: POST_NATIVE_TLS_MERGE^2~78^2~3 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fe501914f0794b255057f4735461bb21366bc1f2;p=php Micro optimization --- diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c index 0c455b84d3..7348dda822 100644 --- a/Zend/zend_execute.c +++ b/Zend/zend_execute.c @@ -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); diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 91036489be..6aeac0e2d1 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -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); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index fba611a1e2..e68cf1945c 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -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);