From 4495ea47404fc0402ac4be7e4b7c9cde28df30ec Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Tue, 22 Nov 2016 12:06:39 +0300 Subject: [PATCH] Micro-optimization --- Zend/zend_vm_def.h | 4 ++-- Zend/zend_vm_execute.h | 36 ++++++++++++++++++------------------ 2 files changed, 20 insertions(+), 20 deletions(-) diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index fa759f0372..6e82ddba8f 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -1738,7 +1738,8 @@ ZEND_VM_HELPER(zend_fetch_static_prop_helper, CONST|TMPVAR|CV, UNUSED|CONST|VAR, } } retval = zend_std_get_static_property(ce, name, 0); - if (UNEXPECTED(EG(exception))) { + if (UNEXPECTED(retval == NULL)) { + ZEND_ASSERT(EG(exception)); if (OP1_TYPE != IS_CONST) { zend_string_release(name); } @@ -1756,7 +1757,6 @@ ZEND_VM_HELPER(zend_fetch_static_prop_helper, CONST|TMPVAR|CV, UNUSED|CONST|VAR, } ZEND_VM_C_LABEL(fetch_static_prop_return): - ZEND_ASSERT(retval != NULL); if (type == BP_VAR_R || type == BP_VAR_IS) { ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval); } else { diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 18234bccb0..fc1b7f571d 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -4916,7 +4916,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_ } } retval = zend_std_get_static_property(ce, name, 0); - if (UNEXPECTED(EG(exception))) { + if (UNEXPECTED(retval == NULL)) { + ZEND_ASSERT(EG(exception)); if (IS_CONST != IS_CONST) { zend_string_release(name); } @@ -4932,7 +4933,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_ } fetch_static_prop_return: - ZEND_ASSERT(retval != NULL); if (type == BP_VAR_R || type == BP_VAR_IS) { ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval); } else { @@ -6769,7 +6769,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_ } } retval = zend_std_get_static_property(ce, name, 0); - if (UNEXPECTED(EG(exception))) { + if (UNEXPECTED(retval == NULL)) { + ZEND_ASSERT(EG(exception)); if (IS_CONST != IS_CONST) { zend_string_release(name); } @@ -6785,7 +6786,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_ } fetch_static_prop_return: - ZEND_ASSERT(retval != NULL); if (type == BP_VAR_R || type == BP_VAR_IS) { ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval); } else { @@ -7341,7 +7341,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_ } } retval = zend_std_get_static_property(ce, name, 0); - if (UNEXPECTED(EG(exception))) { + if (UNEXPECTED(retval == NULL)) { + ZEND_ASSERT(EG(exception)); if (IS_CONST != IS_CONST) { zend_string_release(name); } @@ -7357,7 +7358,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_ } fetch_static_prop_return: - ZEND_ASSERT(retval != NULL); if (type == BP_VAR_R || type == BP_VAR_IS) { ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval); } else { @@ -37970,7 +37970,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_ } } retval = zend_std_get_static_property(ce, name, 0); - if (UNEXPECTED(EG(exception))) { + if (UNEXPECTED(retval == NULL)) { + ZEND_ASSERT(EG(exception)); if (IS_CV != IS_CONST) { zend_string_release(name); } @@ -37986,7 +37987,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_ } fetch_static_prop_return: - ZEND_ASSERT(retval != NULL); if (type == BP_VAR_R || type == BP_VAR_IS) { ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval); } else { @@ -41029,7 +41029,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_ } } retval = zend_std_get_static_property(ce, name, 0); - if (UNEXPECTED(EG(exception))) { + if (UNEXPECTED(retval == NULL)) { + ZEND_ASSERT(EG(exception)); if (IS_CV != IS_CONST) { zend_string_release(name); } @@ -41045,7 +41046,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_ } fetch_static_prop_return: - ZEND_ASSERT(retval != NULL); if (type == BP_VAR_R || type == BP_VAR_IS) { ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval); } else { @@ -42077,7 +42077,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_ } } retval = zend_std_get_static_property(ce, name, 0); - if (UNEXPECTED(EG(exception))) { + if (UNEXPECTED(retval == NULL)) { + ZEND_ASSERT(EG(exception)); if (IS_CV != IS_CONST) { zend_string_release(name); } @@ -42093,7 +42094,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_ } fetch_static_prop_return: - ZEND_ASSERT(retval != NULL); if (type == BP_VAR_R || type == BP_VAR_IS) { ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval); } else { @@ -52433,7 +52433,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_ } } retval = zend_std_get_static_property(ce, name, 0); - if (UNEXPECTED(EG(exception))) { + if (UNEXPECTED(retval == NULL)) { + ZEND_ASSERT(EG(exception)); if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { zend_string_release(name); } @@ -52451,7 +52452,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_ } fetch_static_prop_return: - ZEND_ASSERT(retval != NULL); if (type == BP_VAR_R || type == BP_VAR_IS) { ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval); } else { @@ -53382,7 +53382,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_ } } retval = zend_std_get_static_property(ce, name, 0); - if (UNEXPECTED(EG(exception))) { + if (UNEXPECTED(retval == NULL)) { + ZEND_ASSERT(EG(exception)); if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { zend_string_release(name); } @@ -53400,7 +53401,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_ } fetch_static_prop_return: - ZEND_ASSERT(retval != NULL); if (type == BP_VAR_R || type == BP_VAR_IS) { ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval); } else { @@ -53870,7 +53870,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_ } } retval = zend_std_get_static_property(ce, name, 0); - if (UNEXPECTED(EG(exception))) { + if (UNEXPECTED(retval == NULL)) { + ZEND_ASSERT(EG(exception)); if ((IS_TMP_VAR|IS_VAR) != IS_CONST) { zend_string_release(name); } @@ -53888,7 +53889,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_ } fetch_static_prop_return: - ZEND_ASSERT(retval != NULL); if (type == BP_VAR_R || type == BP_VAR_IS) { ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval); } else { -- 2.50.1