com php-src: Saving the latter checking in most cases: Zend/zend_vm_def.h Zend/zend_vm_execute.h

From: Date: Mon, 04 May 2015 11:21:54 +0000
Subject: com php-src: Saving the latter checking in most cases: Zend/zend_vm_def.h Zend/zend_vm_execute.h
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-86582@lists.php.net to get a copy of this message
Commit: 7af9ba23a75a06ef9ef78273b440fe373f1139e3 Author: Xinchen Hui <laruence@php.net> Mon, 4 May 2015 19:21:54 +0800 Parents: fff921d7a3041769023e416082cb88c55807c883 Branches: PHP-5.5 PHP-5.6 master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7af9ba23a75a06ef9ef78273b440fe373f1139e3 Log: Saving the latter checking in most cases Changed paths: M Zend/zend_vm_def.h M Zend/zend_vm_execute.h Diff: diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index 9e68290..040ab74 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -5191,7 +5191,6 @@ ZEND_VM_HANDLER(153, ZEND_DECLARE_LAMBDA_FUNCTION, CONST, UNUSED) { USE_OPLINE zend_function *op_array; - int closure_is_static, closure_is_being_defined_inside_static_context; SAVE_OPLINE(); @@ -5200,9 +5199,9 @@ ZEND_VM_HANDLER(153, ZEND_DECLARE_LAMBDA_FUNCTION, CONST, UNUSED) zend_error_noreturn(E_ERROR, "Base lambda function for closure not found"); } - closure_is_static = op_array->common.fn_flags & ZEND_ACC_STATIC; - closure_is_being_defined_inside_static_context = EX(prev_execute_data) && EX(prev_execute_data)->function_state.function->common.fn_flags & ZEND_ACC_STATIC; - if (closure_is_static || closure_is_being_defined_inside_static_context) { + if (UNEXPECTED((op_array->common.fn_flags & ZEND_ACC_STATIC) || + (EX(prev_execute_data) && + EX(prev_execute_data)->function_state.function->common.fn_flags & ZEND_ACC_STATIC))) { zend_create_closure(&EX_T(opline->result.var).tmp_var, (zend_function *) op_array, EG(called_scope), NULL TSRMLS_CC); } else { zend_create_closure(&EX_T(opline->result.var).tmp_var, (zend_function *) op_array, EG(scope), EG(This) TSRMLS_CC); diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 706d00b..6ab0232 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -6494,7 +6494,6 @@ static int ZEND_FASTCALL ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST_UNUSED_HANDLER { USE_OPLINE zend_function *op_array; - int closure_is_static, closure_is_being_defined_inside_static_context; SAVE_OPLINE(); @@ -6503,9 +6502,9 @@ static int ZEND_FASTCALL ZEND_DECLARE_LAMBDA_FUNCTION_SPEC_CONST_UNUSED_HANDLER zend_error_noreturn(E_ERROR, "Base lambda function for closure not found"); } - closure_is_static = op_array->common.fn_flags & ZEND_ACC_STATIC; - closure_is_being_defined_inside_static_context = EX(prev_execute_data) && EX(prev_execute_data)->function_state.function->common.fn_flags & ZEND_ACC_STATIC; - if (closure_is_static || closure_is_being_defined_inside_static_context) { + if (UNEXPECTED((op_array->common.fn_flags & ZEND_ACC_STATIC) || + (EX(prev_execute_data) && + EX(prev_execute_data)->function_state.function->common.fn_flags & ZEND_ACC_STATIC))) { zend_create_closure(&EX_T(opline->result.var).tmp_var, (zend_function *) op_array, EG(called_scope), NULL TSRMLS_CC); } else { zend_create_closure(&EX_T(opline->result.var).tmp_var, (zend_function *) op_array, EG(scope), EG(This) TSRMLS_CC);

« previous php.cvs (#86582) next »