Generatirs are going to be used less than regular functions

This commit is contained in:
Dmitry Stogov 2012-12-06 13:14:31 +04:00
parent 8ca4288fd2
commit e3b2a5cf74
3 changed files with 3 additions and 3 deletions

View File

@ -1598,7 +1598,7 @@ static zend_always_inline zend_execute_data *i_create_execute_data_from_op_array
* restore it simply by replacing a pointer. The same segment also keeps
* a copy of previous execute_data and passed parameters.
*/
if (op_array->fn_flags & ZEND_ACC_GENERATOR) {
if (UNEXPECTED((op_array->fn_flags & ZEND_ACC_GENERATOR) != 0)) {
/* Prepend the regular stack frame with copy on prev_execute_data
* and passed arguments
*/

View File

@ -2049,7 +2049,7 @@ ZEND_VM_HELPER(zend_do_fcall_common_helper, ANY, ANY)
ret->var.fcall_returned_reference = (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
}
if (EG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) {
if (UNEXPECTED((EG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) != 0)) {
if (RETURN_VALUE_USED(opline)) {
EX_T(opline->result.var).var.ptr = zend_generator_create_zval(EG(active_op_array) TSRMLS_CC);
}

View File

@ -590,7 +590,7 @@ static int ZEND_FASTCALL zend_do_fcall_common_helper_SPEC(ZEND_OPCODE_HANDLER_AR
ret->var.fcall_returned_reference = (fbc->common.fn_flags & ZEND_ACC_RETURN_REFERENCE) != 0;
}
if (EG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) {
if (UNEXPECTED((EG(active_op_array)->fn_flags & ZEND_ACC_GENERATOR) != 0)) {
if (RETURN_VALUE_USED(opline)) {
EX_T(opline->result.var).var.ptr = zend_generator_create_zval(EG(active_op_array) TSRMLS_CC);
}