From 25d97f5eeeaf2eca760139f04fe2711e71791d0f Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 5 Sep 2019 13:44:46 +0300 Subject: [PATCH] Microoptimization (avoid code duplication) --- Zend/zend_vm_def.h | 14 ++++++-------- Zend/zend_vm_execute.h | 28 ++++++++++++---------------- 2 files changed, 18 insertions(+), 24 deletions(-) diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h index f8e7cad985..8dbcfe850a 100644 --- a/Zend/zend_vm_def.h +++ b/Zend/zend_vm_def.h @@ -4016,10 +4016,9 @@ ZEND_VM_HOT_HANDLER(129, ZEND_DO_ICALL, ANY, ANY, SPEC(RETVAL)) if (UNEXPECTED(EG(exception) != NULL)) { zend_rethrow_exception(execute_data); - HANDLE_EXCEPTION(); + } else { + ZEND_VM_SET_OPCODE(opline + 1); } - - ZEND_VM_SET_OPCODE(opline + 1); ZEND_VM_CONTINUE(); } @@ -4124,9 +4123,9 @@ ZEND_VM_C_LABEL(fcall_end): if (UNEXPECTED(EG(exception) != NULL)) { zend_rethrow_exception(execute_data); - HANDLE_EXCEPTION(); + } else { + ZEND_VM_SET_OPCODE(opline + 1); } - ZEND_VM_SET_OPCODE(opline + 1); ZEND_VM_CONTINUE(); } @@ -4235,10 +4234,9 @@ ZEND_VM_C_LABEL(fcall_end): zend_vm_stack_free_call_frame(call); if (UNEXPECTED(EG(exception) != NULL)) { zend_rethrow_exception(execute_data); - HANDLE_EXCEPTION(); + } else { + ZEND_VM_SET_OPCODE(opline + 1); } - - ZEND_VM_SET_OPCODE(opline + 1); ZEND_VM_CONTINUE(); } diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h index 8882f18d14..34e290093d 100644 --- a/Zend/zend_vm_execute.h +++ b/Zend/zend_vm_execute.h @@ -1286,10 +1286,9 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_ICALL_SPEC_RETV if (UNEXPECTED(EG(exception) != NULL)) { zend_rethrow_exception(execute_data); - HANDLE_EXCEPTION(); + } else { + ZEND_VM_SET_OPCODE(opline + 1); } - - ZEND_VM_SET_OPCODE(opline + 1); ZEND_VM_CONTINUE(); } @@ -1331,10 +1330,9 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_ICALL_SPEC_RETV if (UNEXPECTED(EG(exception) != NULL)) { zend_rethrow_exception(execute_data); - HANDLE_EXCEPTION(); + } else { + ZEND_VM_SET_OPCODE(opline + 1); } - - ZEND_VM_SET_OPCODE(opline + 1); ZEND_VM_CONTINUE(); } @@ -1462,9 +1460,9 @@ fcall_end: if (UNEXPECTED(EG(exception) != NULL)) { zend_rethrow_exception(execute_data); - HANDLE_EXCEPTION(); + } else { + ZEND_VM_SET_OPCODE(opline + 1); } - ZEND_VM_SET_OPCODE(opline + 1); ZEND_VM_CONTINUE(); } @@ -1546,9 +1544,9 @@ fcall_end: if (UNEXPECTED(EG(exception) != NULL)) { zend_rethrow_exception(execute_data); - HANDLE_EXCEPTION(); + } else { + ZEND_VM_SET_OPCODE(opline + 1); } - ZEND_VM_SET_OPCODE(opline + 1); ZEND_VM_CONTINUE(); } @@ -1657,10 +1655,9 @@ fcall_end: zend_vm_stack_free_call_frame(call); if (UNEXPECTED(EG(exception) != NULL)) { zend_rethrow_exception(execute_data); - HANDLE_EXCEPTION(); + } else { + ZEND_VM_SET_OPCODE(opline + 1); } - - ZEND_VM_SET_OPCODE(opline + 1); ZEND_VM_CONTINUE(); } @@ -1769,10 +1766,9 @@ fcall_end: zend_vm_stack_free_call_frame(call); if (UNEXPECTED(EG(exception) != NULL)) { zend_rethrow_exception(execute_data); - HANDLE_EXCEPTION(); + } else { + ZEND_VM_SET_OPCODE(opline + 1); } - - ZEND_VM_SET_OPCODE(opline + 1); ZEND_VM_CONTINUE(); } -- 2.50.0