Skip to content

Commit 25d97f5

Browse files
committed
Microoptimization (avoid code duplication)
1 parent 7237da2 commit 25d97f5

File tree

2 files changed

+18
-24
lines changed

2 files changed

+18
-24
lines changed

Zend/zend_vm_def.h

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4016,10 +4016,9 @@ ZEND_VM_HOT_HANDLER(129, ZEND_DO_ICALL, ANY, ANY, SPEC(RETVAL))
40164016

40174017
if (UNEXPECTED(EG(exception) != NULL)) {
40184018
zend_rethrow_exception(execute_data);
4019-
HANDLE_EXCEPTION();
4019+
} else {
4020+
ZEND_VM_SET_OPCODE(opline + 1);
40204021
}
4021-
4022-
ZEND_VM_SET_OPCODE(opline + 1);
40234022
ZEND_VM_CONTINUE();
40244023
}
40254024

@@ -4124,9 +4123,9 @@ ZEND_VM_C_LABEL(fcall_end):
41244123

41254124
if (UNEXPECTED(EG(exception) != NULL)) {
41264125
zend_rethrow_exception(execute_data);
4127-
HANDLE_EXCEPTION();
4126+
} else {
4127+
ZEND_VM_SET_OPCODE(opline + 1);
41284128
}
4129-
ZEND_VM_SET_OPCODE(opline + 1);
41304129
ZEND_VM_CONTINUE();
41314130
}
41324131

@@ -4235,10 +4234,9 @@ ZEND_VM_C_LABEL(fcall_end):
42354234
zend_vm_stack_free_call_frame(call);
42364235
if (UNEXPECTED(EG(exception) != NULL)) {
42374236
zend_rethrow_exception(execute_data);
4238-
HANDLE_EXCEPTION();
4237+
} else {
4238+
ZEND_VM_SET_OPCODE(opline + 1);
42394239
}
4240-
4241-
ZEND_VM_SET_OPCODE(opline + 1);
42424240
ZEND_VM_CONTINUE();
42434241
}
42444242

Zend/zend_vm_execute.h

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1286,10 +1286,9 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_ICALL_SPEC_RETV
12861286

12871287
if (UNEXPECTED(EG(exception) != NULL)) {
12881288
zend_rethrow_exception(execute_data);
1289-
HANDLE_EXCEPTION();
1289+
} else {
1290+
ZEND_VM_SET_OPCODE(opline + 1);
12901291
}
1291-
1292-
ZEND_VM_SET_OPCODE(opline + 1);
12931292
ZEND_VM_CONTINUE();
12941293
}
12951294

@@ -1331,10 +1330,9 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_ICALL_SPEC_RETV
13311330

13321331
if (UNEXPECTED(EG(exception) != NULL)) {
13331332
zend_rethrow_exception(execute_data);
1334-
HANDLE_EXCEPTION();
1333+
} else {
1334+
ZEND_VM_SET_OPCODE(opline + 1);
13351335
}
1336-
1337-
ZEND_VM_SET_OPCODE(opline + 1);
13381336
ZEND_VM_CONTINUE();
13391337
}
13401338

@@ -1462,9 +1460,9 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_S
14621460

14631461
if (UNEXPECTED(EG(exception) != NULL)) {
14641462
zend_rethrow_exception(execute_data);
1465-
HANDLE_EXCEPTION();
1463+
} else {
1464+
ZEND_VM_SET_OPCODE(opline + 1);
14661465
}
1467-
ZEND_VM_SET_OPCODE(opline + 1);
14681466
ZEND_VM_CONTINUE();
14691467
}
14701468

@@ -1546,9 +1544,9 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_S
15461544

15471545
if (UNEXPECTED(EG(exception) != NULL)) {
15481546
zend_rethrow_exception(execute_data);
1549-
HANDLE_EXCEPTION();
1547+
} else {
1548+
ZEND_VM_SET_OPCODE(opline + 1);
15501549
}
1551-
ZEND_VM_SET_OPCODE(opline + 1);
15521550
ZEND_VM_CONTINUE();
15531551
}
15541552

@@ -1657,10 +1655,9 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RETV
16571655
zend_vm_stack_free_call_frame(call);
16581656
if (UNEXPECTED(EG(exception) != NULL)) {
16591657
zend_rethrow_exception(execute_data);
1660-
HANDLE_EXCEPTION();
1658+
} else {
1659+
ZEND_VM_SET_OPCODE(opline + 1);
16611660
}
1662-
1663-
ZEND_VM_SET_OPCODE(opline + 1);
16641661
ZEND_VM_CONTINUE();
16651662
}
16661663

@@ -1769,10 +1766,9 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RETV
17691766
zend_vm_stack_free_call_frame(call);
17701767
if (UNEXPECTED(EG(exception) != NULL)) {
17711768
zend_rethrow_exception(execute_data);
1772-
HANDLE_EXCEPTION();
1769+
} else {
1770+
ZEND_VM_SET_OPCODE(opline + 1);
17731771
}
1774-
1775-
ZEND_VM_SET_OPCODE(opline + 1);
17761772
ZEND_VM_CONTINUE();
17771773
}
17781774

0 commit comments

Comments
 (0)