Skip to content

Commit 4495ea4

Browse files
committed
Micro-optimization
1 parent 8d70b04 commit 4495ea4

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
@@ -4916,7 +4916,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
49164916
}
49174917
}
49184918
retval = zend_std_get_static_property(ce, name, 0);
4919-
if (UNEXPECTED(EG(exception))) {
4919+
if (UNEXPECTED(retval == NULL)) {
4920+
ZEND_ASSERT(EG(exception));
49204921
if (IS_CONST != IS_CONST) {
49214922
zend_string_release(name);
49224923
}
@@ -4932,7 +4933,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
49324933
}
49334934

49344935
fetch_static_prop_return:
4935-
ZEND_ASSERT(retval != NULL);
49364936
if (type == BP_VAR_R || type == BP_VAR_IS) {
49374937
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
49384938
} else {
@@ -6769,7 +6769,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
67696769
}
67706770
}
67716771
retval = zend_std_get_static_property(ce, name, 0);
6772-
if (UNEXPECTED(EG(exception))) {
6772+
if (UNEXPECTED(retval == NULL)) {
6773+
ZEND_ASSERT(EG(exception));
67736774
if (IS_CONST != IS_CONST) {
67746775
zend_string_release(name);
67756776
}
@@ -6785,7 +6786,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
67856786
}
67866787

67876788
fetch_static_prop_return:
6788-
ZEND_ASSERT(retval != NULL);
67896789
if (type == BP_VAR_R || type == BP_VAR_IS) {
67906790
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
67916791
} else {
@@ -7341,7 +7341,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
73417341
}
73427342
}
73437343
retval = zend_std_get_static_property(ce, name, 0);
7344-
if (UNEXPECTED(EG(exception))) {
7344+
if (UNEXPECTED(retval == NULL)) {
7345+
ZEND_ASSERT(EG(exception));
73457346
if (IS_CONST != IS_CONST) {
73467347
zend_string_release(name);
73477348
}
@@ -7357,7 +7358,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
73577358
}
73587359

73597360
fetch_static_prop_return:
7360-
ZEND_ASSERT(retval != NULL);
73617361
if (type == BP_VAR_R || type == BP_VAR_IS) {
73627362
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
73637363
} else {
@@ -37970,7 +37970,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
3797037970
}
3797137971
}
3797237972
retval = zend_std_get_static_property(ce, name, 0);
37973-
if (UNEXPECTED(EG(exception))) {
37973+
if (UNEXPECTED(retval == NULL)) {
37974+
ZEND_ASSERT(EG(exception));
3797437975
if (IS_CV != IS_CONST) {
3797537976
zend_string_release(name);
3797637977
}
@@ -37986,7 +37987,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
3798637987
}
3798737988

3798837989
fetch_static_prop_return:
37989-
ZEND_ASSERT(retval != NULL);
3799037990
if (type == BP_VAR_R || type == BP_VAR_IS) {
3799137991
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
3799237992
} else {
@@ -41029,7 +41029,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
4102941029
}
4103041030
}
4103141031
retval = zend_std_get_static_property(ce, name, 0);
41032-
if (UNEXPECTED(EG(exception))) {
41032+
if (UNEXPECTED(retval == NULL)) {
41033+
ZEND_ASSERT(EG(exception));
4103341034
if (IS_CV != IS_CONST) {
4103441035
zend_string_release(name);
4103541036
}
@@ -41045,7 +41046,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
4104541046
}
4104641047

4104741048
fetch_static_prop_return:
41048-
ZEND_ASSERT(retval != NULL);
4104941049
if (type == BP_VAR_R || type == BP_VAR_IS) {
4105041050
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
4105141051
} else {
@@ -42077,7 +42077,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
4207742077
}
4207842078
}
4207942079
retval = zend_std_get_static_property(ce, name, 0);
42080-
if (UNEXPECTED(EG(exception))) {
42080+
if (UNEXPECTED(retval == NULL)) {
42081+
ZEND_ASSERT(EG(exception));
4208142082
if (IS_CV != IS_CONST) {
4208242083
zend_string_release(name);
4208342084
}
@@ -42093,7 +42094,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
4209342094
}
4209442095

4209542096
fetch_static_prop_return:
42096-
ZEND_ASSERT(retval != NULL);
4209742097
if (type == BP_VAR_R || type == BP_VAR_IS) {
4209842098
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
4209942099
} else {
@@ -52433,7 +52433,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
5243352433
}
5243452434
}
5243552435
retval = zend_std_get_static_property(ce, name, 0);
52436-
if (UNEXPECTED(EG(exception))) {
52436+
if (UNEXPECTED(retval == NULL)) {
52437+
ZEND_ASSERT(EG(exception));
5243752438
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
5243852439
zend_string_release(name);
5243952440
}
@@ -52451,7 +52452,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
5245152452
}
5245252453

5245352454
fetch_static_prop_return:
52454-
ZEND_ASSERT(retval != NULL);
5245552455
if (type == BP_VAR_R || type == BP_VAR_IS) {
5245652456
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
5245752457
} else {
@@ -53382,7 +53382,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
5338253382
}
5338353383
}
5338453384
retval = zend_std_get_static_property(ce, name, 0);
53385-
if (UNEXPECTED(EG(exception))) {
53385+
if (UNEXPECTED(retval == NULL)) {
53386+
ZEND_ASSERT(EG(exception));
5338653387
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
5338753388
zend_string_release(name);
5338853389
}
@@ -53400,7 +53401,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
5340053401
}
5340153402

5340253403
fetch_static_prop_return:
53403-
ZEND_ASSERT(retval != NULL);
5340453404
if (type == BP_VAR_R || type == BP_VAR_IS) {
5340553405
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
5340653406
} else {
@@ -53870,7 +53870,8 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
5387053870
}
5387153871
}
5387253872
retval = zend_std_get_static_property(ce, name, 0);
53873-
if (UNEXPECTED(EG(exception))) {
53873+
if (UNEXPECTED(retval == NULL)) {
53874+
ZEND_ASSERT(EG(exception));
5387453875
if ((IS_TMP_VAR|IS_VAR) != IS_CONST) {
5387553876
zend_string_release(name);
5387653877
}
@@ -53888,7 +53889,6 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_fetch_static_prop_helper_SPEC_
5388853889
}
5388953890

5389053891
fetch_static_prop_return:
53891-
ZEND_ASSERT(retval != NULL);
5389253892
if (type == BP_VAR_R || type == BP_VAR_IS) {
5389353893
ZVAL_COPY_UNREF(EX_VAR(opline->result.var), retval);
5389453894
} else {

0 commit comments

Comments
 (0)