com php-src: Micro-optimization: Zend/zend_vm_def.h Zen d/zend_vm_execute.h
| From: | Dmitry Stogov | Date: | Tue, 22 Nov 2016 09:06:39 +0000 |
| Subject: | com php-src: Micro-optimization: Zend/zend_vm_def.h Zen d/zend_vm_execute.h | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-95971@lists.php.net to get a copy of this message | ||
Commit: 4495ea47404fc0402ac4be7e4b7c9cde28df30ec
Author: Dmitry Stogov <dmitry@zend.com> Tue, 22 Nov 2016 12:06:39 +0300
Parents: 8d70b04a1c33a756212d0ba3a48260dc03925482
Branches: PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=4495ea47404fc0402ac4be7e4b7c9cde28df30ec
Log:
Micro-optimization
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 fa759f0..6e82ddb 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 18234bc..fc1b7f5 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 {