Skip to content

Commit e5fce51

Browse files
committed
Merge branch 'PHP-7.1'
* PHP-7.1: Micro-optimization
2 parents 653c9e1 + 4495ea4 commit e5fce51

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

Zend/zend_vm_def.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1738,7 +1738,8 @@ ZEND_VM_HELPER(zend_fetch_static_prop_helper, CONST|TMPVAR|CV, UNUSED|CONST|VAR,
17381738
}
17391739
}
17401740
retval = zend_std_get_static_property(ce, name, 0);
1741-
if (UNEXPECTED(EG(exception))) {
1741+
if (UNEXPECTED(retval == NULL)) {
1742+
ZEND_ASSERT(EG(exception));
17421743
if (OP1_TYPE != IS_CONST) {
17431744
zend_string_release(name);
17441745
}
@@ -1756,7 +1757,6 @@ ZEND_VM_HELPER(zend_fetch_static_prop_helper, CONST|TMPVAR|CV, UNUSED|CONST|VAR,
17561757
}
17571758

17581759
ZEND_VM_C_LABEL(fetch_static_prop_return):
1759-
ZEND_ASSERT(retval != NULL);
17601760
if (type == BP_VAR_R || type == BP_VAR_IS) {
17611761
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
17621762
} else {

Zend/zend_vm_execute.h

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4895,7 +4895,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
48954895
}
48964896
}
48974897
retval = zend_std_get_static_property(ce, name, 0);
4898-
if (UNEXPECTED(EG(exception))) {
4898+
if (UNEXPECTED(retval == NULL)) {
4899+
ZEND_ASSERT(EG(exception));
48994900
if (IS_CONST != IS_CONST) {
49004901
zend_string_release(name);
49014902
}
@@ -4911,7 +4912,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
49114912
}
49124913

49134914
fetch_static_prop_return:
4914-
ZEND_ASSERT(retval != NULL);
49154915
if (type == BP_VAR_R || type == BP_VAR_IS) {
49164916
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
49174917
} else {
@@ -6748,7 +6748,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
67486748
}
67496749
}
67506750
retval = zend_std_get_static_property(ce, name, 0);
6751-
if (UNEXPECTED(EG(exception))) {
6751+
if (UNEXPECTED(retval == NULL)) {
6752+
ZEND_ASSERT(EG(exception));
67526753
if (IS_CONST != IS_CONST) {
67536754
zend_string_release(name);
67546755
}
@@ -6764,7 +6765,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
67646765
}
67656766

67666767
fetch_static_prop_return:
6767-
ZEND_ASSERT(retval != NULL);
67686768
if (type == BP_VAR_R || type == BP_VAR_IS) {
67696769
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
67706770
} else {
@@ -7320,7 +7320,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
73207320
}
73217321
}
73227322
retval = zend_std_get_static_property(ce, name, 0);
7323-
if (UNEXPECTED(EG(exception))) {
7323+
if (UNEXPECTED(retval == NULL)) {
7324+
ZEND_ASSERT(EG(exception));
73247325
if (IS_CONST != IS_CONST) {
73257326
zend_string_release(name);
73267327
}
@@ -7336,7 +7337,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
73367337
}
73377338

73387339
fetch_static_prop_return:
7339-
ZEND_ASSERT(retval != NULL);
73407340
if (type == BP_VAR_R || type == BP_VAR_IS) {
73417341
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
73427342
} else {
@@ -37879,7 +37879,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
3787937879
}
3788037880
}
3788137881
retval = zend_std_get_static_property(ce, name, 0);
37882-
if (UNEXPECTED(EG(exception))) {
37882+
if (UNEXPECTED(retval == NULL)) {
37883+
ZEND_ASSERT(EG(exception));
3788337884
if (IS_CV != IS_CONST) {
3788437885
zend_string_release(name);
3788537886
}
@@ -37895,7 +37896,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
3789537896
}
3789637897

3789737898
fetch_static_prop_return:
37898-
ZEND_ASSERT(retval != NULL);
3789937899
if (type == BP_VAR_R || type == BP_VAR_IS) {
3790037900
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
3790137901
} else {
@@ -40939,7 +40939,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
4093940939
}
4094040940
}
4094140941
retval = zend_std_get_static_property(ce, name, 0);
40942-
if (UNEXPECTED(EG(exception))) {
40942+
if (UNEXPECTED(retval == NULL)) {
40943+
ZEND_ASSERT(EG(exception));
4094340944
if (IS_CV != IS_CONST) {
4094440945
zend_string_release(name);
4094540946
}
@@ -40955,7 +40956,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
4095540956
}
4095640957

4095740958
fetch_static_prop_return:
40958-
ZEND_ASSERT(retval != NULL);
4095940959
if (type == BP_VAR_R || type == BP_VAR_IS) {
4096040960
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
4096140961
} else {
@@ -41987,7 +41987,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
4198741987
}
4198841988
}
4198941989
retval = zend_std_get_static_property(ce, name, 0);
41990-
if (UNEXPECTED(EG(exception))) {
41990+
if (UNEXPECTED(retval == NULL)) {
41991+
ZEND_ASSERT(EG(exception));
4199141992
if (IS_CV != IS_CONST) {
4199241993
zend_string_release(name);
4199341994
}
@@ -42003,7 +42004,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
4200342004
}
4200442005

4200542006
fetch_static_prop_return:
42006-
ZEND_ASSERT(retval != NULL);
4200742007
if (type == BP_VAR_R || type == BP_VAR_IS) {
4200842008
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
4200942009
} else {
@@ -52336,7 +52336,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
5233652336
}
5233752337
}
5233852338
retval = zend_std_get_static_property(ce, name, 0);
52339-
if (UNEXPECTED(EG(exception))) {
52339+
if (UNEXPECTED(retval == NULL)) {
52340+
ZEND_ASSERT(EG(exception));
5234052341
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
5234152342
zend_string_release(name);
5234252343
}
@@ -52354,7 +52355,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
5235452355
}
5235552356

5235652357
fetch_static_prop_return:
52357-
ZEND_ASSERT(retval != NULL);
5235852358
if (type == BP_VAR_R || type == BP_VAR_IS) {
5235952359
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
5236052360
} else {
@@ -53285,7 +53285,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
5328553285
}
5328653286
}
5328753287
retval = zend_std_get_static_property(ce, name, 0);
53288-
if (UNEXPECTED(EG(exception))) {
53288+
if (UNEXPECTED(retval == NULL)) {
53289+
ZEND_ASSERT(EG(exception));
5328953290
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
5329053291
zend_string_release(name);
5329153292
}
@@ -53303,7 +53304,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
5330353304
}
5330453305

5330553306
fetch_static_prop_return:
53306-
ZEND_ASSERT(retval != NULL);
5330753307
if (type == BP_VAR_R || type == BP_VAR_IS) {
5330853308
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
5330953309
} else {
@@ -53773,7 +53773,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
5377353773
}
5377453774
}
5377553775
retval = zend_std_get_static_property(ce, name, 0);
53776-
if (UNEXPECTED(EG(exception))) {
53776+
if (UNEXPECTED(retval == NULL)) {
53777+
ZEND_ASSERT(EG(exception));
5377753778
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
5377853779
zend_string_release(name);
5377953780
}
@@ -53791,7 +53792,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
5379153792
}
5379253793

5379353794
fetch_static_prop_return:
53794-
ZEND_ASSERT(retval != NULL);
5379553795
if (type == BP_VAR_R || type == BP_VAR_IS) {
5379653796
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
5379753797
} else {

0 commit comments

Comments
 (0)