]> granicus.if.org Git - php/commitdiff
Micro-optimization
authorDmitry Stogov <dmitry@zend.com>
Tue, 22 Nov 2016 09:06:39 +0000 (12:06 +0300)
committerDmitry Stogov <dmitry@zend.com>
Tue, 22 Nov 2016 09:06:39 +0000 (12:06 +0300)
Zend/zend_vm_def.h
Zend/zend_vm_execute.h

index fa759f03721a568108e6684ce10e5d4fd7a8dbd1..6e82ddba8f9d4d5ccaa9e3f6b2f55092a847551e 100644 (file)
@@ -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 {
index 18234bccb0896d14020fcfbd2dbd9132f36730d2..fc1b7f571dd35b01f4dbd84fd0e7e9f240dfc604 100644 (file)
@@ -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 {