From a817c65b50619aedd807dce0b2c76db33ac4dc86 Mon Sep 17 00:00:00 2001 From: Remi Collet Date: Thu, 13 Jun 2019 10:21:44 +0200 Subject: add 3 upstream patches --- 175c7bf6fe0ceeb4b5dc08e08837b411ab05ff6b.patch | 315 +++++++++++++++++++++++++ 1 file changed, 315 insertions(+) create mode 100644 175c7bf6fe0ceeb4b5dc08e08837b411ab05ff6b.patch (limited to '175c7bf6fe0ceeb4b5dc08e08837b411ab05ff6b.patch') diff --git a/175c7bf6fe0ceeb4b5dc08e08837b411ab05ff6b.patch b/175c7bf6fe0ceeb4b5dc08e08837b411ab05ff6b.patch new file mode 100644 index 0000000..d5acd34 --- /dev/null +++ b/175c7bf6fe0ceeb4b5dc08e08837b411ab05ff6b.patch @@ -0,0 +1,315 @@ +From 175c7bf6fe0ceeb4b5dc08e08837b411ab05ff6b Mon Sep 17 00:00:00 2001 +From: Joe Watkins +Date: Wed, 12 Jun 2019 20:04:47 +0200 +Subject: [PATCH] Revert "micro-optimization" + +This reverts commit 374f7699821eb723a3a82a9854d18c0530b9d4e9. +--- + Zend/zend_execute.c | 3 +++ + Zend/zend_vm_def.h | 18 +++++++++--------- + Zend/zend_vm_execute.h | 29 ++++++++++++----------------- + Zend/zend_vm_gen.php | 17 ----------------- + 4 files changed, 24 insertions(+), 43 deletions(-) + +diff --git a/Zend/zend_execute.c b/Zend/zend_execute.c +index 677190821946..4c2fef629022 100644 +--- a/Zend/zend_execute.c ++++ b/Zend/zend_execute.c +@@ -3502,6 +3502,9 @@ static zend_always_inline void i_init_func_execute_data(zend_op_array *op_array, + EX(run_time_cache) = RUN_TIME_CACHE(op_array); + + EG(current_execute_data) = execute_data; ++#if defined(ZEND_VM_IP_GLOBAL_REG) && ((ZEND_VM_KIND == ZEND_VM_KIND_CALL) || (ZEND_VM_KIND == ZEND_VM_KIND_HYBRID)) ++ EX(opline) = opline; ++#endif + } + /* }}} */ + +diff --git a/Zend/zend_vm_def.h b/Zend/zend_vm_def.h +index 2745908ac240..6c8bce1dd12c 100644 +--- a/Zend/zend_vm_def.h ++++ b/Zend/zend_vm_def.h +@@ -828,12 +828,12 @@ ZEND_VM_COLD_HELPER(zend_this_not_in_object_context_helper, ANY, ANY) + HANDLE_EXCEPTION(); + } + +-ZEND_VM_COLD_HELPER(zend_abstract_method_helper, ANY, ANY, zend_function *_fbc) ++ZEND_VM_COLD_HELPER(zend_abstract_method_helper, ANY, ANY, zend_function *fbc) + { + USE_OPLINE + + SAVE_OPLINE(); +- zend_throw_error(NULL, "Cannot call abstract method %s::%s()", ZSTR_VAL(_fbc->common.scope->name), ZSTR_VAL(_fbc->common.function_name)); ++ zend_throw_error(NULL, "Cannot call abstract method %s::%s()", ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name)); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } +@@ -3842,7 +3842,7 @@ ZEND_VM_HOT_HANDLER(130, ZEND_DO_UCALL, ANY, ANY, SPEC(RETVAL)) + call->prev_execute_data = execute_data; + execute_data = call; + i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); +- LOAD_OPLINE_EX(); ++ LOAD_OPLINE(); + + ZEND_VM_ENTER_EX(); + } +@@ -3866,7 +3866,7 @@ ZEND_VM_HOT_HANDLER(131, ZEND_DO_FCALL_BY_NAME, ANY, ANY, SPEC(RETVAL)) + call->prev_execute_data = execute_data; + execute_data = call; + i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); +- LOAD_OPLINE_EX(); ++ LOAD_OPLINE(); + + ZEND_VM_ENTER_EX(); + } else { +@@ -3934,7 +3934,7 @@ ZEND_VM_HOT_HANDLER(60, ZEND_DO_FCALL, ANY, ANY, SPEC(RETVAL)) + EX(call) = call->prev_execute_data; + if (UNEXPECTED((fbc->common.fn_flags & (ZEND_ACC_ABSTRACT|ZEND_ACC_DEPRECATED)) != 0)) { + if (UNEXPECTED((fbc->common.fn_flags & ZEND_ACC_ABSTRACT) != 0)) { +- ZEND_VM_DISPATCH_TO_HELPER(zend_abstract_method_helper, _fbc, fbc); ++ ZEND_VM_DISPATCH_TO_HELPER(zend_abstract_method_helper, fbc, fbc); + } else { + zend_deprecated_function(fbc); + if (UNEXPECTED(EG(exception) != NULL)) { +@@ -3955,11 +3955,11 @@ ZEND_VM_HOT_HANDLER(60, ZEND_DO_FCALL, ANY, ANY, SPEC(RETVAL)) + i_init_func_execute_data(&fbc->op_array, ret, 1 EXECUTE_DATA_CC); + + if (EXPECTED(zend_execute_ex == execute_ex)) { +- LOAD_OPLINE_EX(); ++ LOAD_OPLINE(); + ZEND_VM_ENTER_EX(); + } else { + execute_data = EX(prev_execute_data); +- SAVE_OPLINE_EX(); ++ LOAD_OPLINE(); + ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP); + zend_execute_ex(call); + } +@@ -7995,11 +7995,11 @@ ZEND_VM_HANDLER(158, ZEND_CALL_TRAMPOLINE, ANY, ANY) + execute_data = call; + i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); + if (EXPECTED(zend_execute_ex == execute_ex)) { +- LOAD_OPLINE_EX(); ++ LOAD_OPLINE(); + ZEND_VM_ENTER_EX(); + } else { + execute_data = EX(prev_execute_data); +- SAVE_OPLINE_EX(); ++ LOAD_OPLINE(); + ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP); + zend_execute_ex(call); + } +diff --git a/Zend/zend_vm_execute.h b/Zend/zend_vm_execute.h +index dff34587ff50..701087a83238 100644 +--- a/Zend/zend_vm_execute.h ++++ b/Zend/zend_vm_execute.h +@@ -398,24 +398,19 @@ typedef ZEND_OPCODE_HANDLER_RET (ZEND_FASTCALL *opcode_handler_t) (ZEND_OPCODE_H + #undef LOAD_OPLINE + #undef LOAD_OPLINE_EX + #undef SAVE_OPLINE +-#undef SAVE_OPLINE_EX + #define DCL_OPLINE + #ifdef ZEND_VM_IP_GLOBAL_REG + # define OPLINE opline + # define USE_OPLINE + # define LOAD_OPLINE() opline = EX(opline) +-# define LOAD_OPLINE_EX() + # define LOAD_NEXT_OPLINE() opline = EX(opline) + 1 + # define SAVE_OPLINE() EX(opline) = opline +-# define SAVE_OPLINE_EX() SAVE_OPLINE() + #else + # define OPLINE EX(opline) + # define USE_OPLINE const zend_op *opline = EX(opline); + # define LOAD_OPLINE() +-# define LOAD_OPLINE_EX() + # define LOAD_NEXT_OPLINE() ZEND_VM_INC_OPCODE() + # define SAVE_OPLINE() +-# define SAVE_OPLINE_EX() + #endif + #undef HANDLE_EXCEPTION + #undef HANDLE_EXCEPTION_LEAVE +@@ -465,12 +460,12 @@ static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_th + HANDLE_EXCEPTION(); + } + +-static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_abstract_method_helper_SPEC(zend_function *_fbc ZEND_OPCODE_HANDLER_ARGS_DC) ++static zend_never_inline ZEND_COLD ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL zend_abstract_method_helper_SPEC(zend_function *fbc ZEND_OPCODE_HANDLER_ARGS_DC) + { + USE_OPLINE + + SAVE_OPLINE(); +- zend_throw_error(NULL, "Cannot call abstract method %s::%s()", ZSTR_VAL(_fbc->common.scope->name), ZSTR_VAL(_fbc->common.function_name)); ++ zend_throw_error(NULL, "Cannot call abstract method %s::%s()", ZSTR_VAL(fbc->common.scope->name), ZSTR_VAL(fbc->common.function_name)); + UNDEF_RESULT(); + HANDLE_EXCEPTION(); + } +@@ -1069,7 +1064,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_UCALL_SPEC_RETV + call->prev_execute_data = execute_data; + execute_data = call; + i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); +- LOAD_OPLINE_EX(); ++ LOAD_OPLINE(); + + ZEND_VM_ENTER_EX(); + } +@@ -1092,7 +1087,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_UCALL_SPEC_RETV + call->prev_execute_data = execute_data; + execute_data = call; + i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); +- LOAD_OPLINE_EX(); ++ LOAD_OPLINE(); + + ZEND_VM_ENTER_EX(); + } +@@ -1116,7 +1111,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_S + call->prev_execute_data = execute_data; + execute_data = call; + i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); +- LOAD_OPLINE_EX(); ++ LOAD_OPLINE(); + + ZEND_VM_ENTER_EX(); + } else { +@@ -1192,7 +1187,7 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_BY_NAME_S + call->prev_execute_data = execute_data; + execute_data = call; + i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); +- LOAD_OPLINE_EX(); ++ LOAD_OPLINE(); + + ZEND_VM_ENTER_EX(); + } else { +@@ -1281,11 +1276,11 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RETV + i_init_func_execute_data(&fbc->op_array, ret, 1 EXECUTE_DATA_CC); + + if (EXPECTED(zend_execute_ex == execute_ex)) { +- LOAD_OPLINE_EX(); ++ LOAD_OPLINE(); + ZEND_VM_ENTER_EX(); + } else { + execute_data = EX(prev_execute_data); +- SAVE_OPLINE_EX(); ++ LOAD_OPLINE(); + ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP); + zend_execute_ex(call); + } +@@ -1391,11 +1386,11 @@ static ZEND_VM_HOT ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_DO_FCALL_SPEC_RETV + i_init_func_execute_data(&fbc->op_array, ret, 1 EXECUTE_DATA_CC); + + if (EXPECTED(zend_execute_ex == execute_ex)) { +- LOAD_OPLINE_EX(); ++ LOAD_OPLINE(); + ZEND_VM_ENTER_EX(); + } else { + execute_data = EX(prev_execute_data); +- SAVE_OPLINE_EX(); ++ LOAD_OPLINE(); + ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP); + zend_execute_ex(call); + } +@@ -2434,11 +2429,11 @@ static ZEND_OPCODE_HANDLER_RET ZEND_FASTCALL ZEND_CALL_TRAMPOLINE_SPEC_HANDLER(Z + execute_data = call; + i_init_func_execute_data(&fbc->op_array, ret, 0 EXECUTE_DATA_CC); + if (EXPECTED(zend_execute_ex == execute_ex)) { +- LOAD_OPLINE_EX(); ++ LOAD_OPLINE(); + ZEND_VM_ENTER_EX(); + } else { + execute_data = EX(prev_execute_data); +- SAVE_OPLINE_EX(); ++ LOAD_OPLINE(); + ZEND_ADD_CALL_FLAG(call, ZEND_CALL_TOP); + zend_execute_ex(call); + } +diff --git a/Zend/zend_vm_gen.php b/Zend/zend_vm_gen.php +index 2e0ad0b2c1c9..d5a27e337177 100755 +--- a/Zend/zend_vm_gen.php ++++ b/Zend/zend_vm_gen.php +@@ -1947,24 +1947,19 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name) + out($f,"#undef LOAD_OPLINE\n"); + out($f,"#undef LOAD_OPLINE_EX\n"); + out($f,"#undef SAVE_OPLINE\n"); +- out($f,"#undef SAVE_OPLINE_EX\n"); + out($f,"#define DCL_OPLINE\n"); + out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n"); + out($f,"# define OPLINE opline\n"); + out($f,"# define USE_OPLINE\n"); + out($f,"# define LOAD_OPLINE() opline = EX(opline)\n"); +- out($f,"# define LOAD_OPLINE_EX()\n"); + out($f,"# define LOAD_NEXT_OPLINE() opline = EX(opline) + 1\n"); + out($f,"# define SAVE_OPLINE() EX(opline) = opline\n"); +- out($f,"# define SAVE_OPLINE_EX() SAVE_OPLINE()\n"); + out($f,"#else\n"); + out($f,"# define OPLINE EX(opline)\n"); + out($f,"# define USE_OPLINE const zend_op *opline = EX(opline);\n"); + out($f,"# define LOAD_OPLINE()\n"); +- out($f,"# define LOAD_OPLINE_EX()\n"); + out($f,"# define LOAD_NEXT_OPLINE() ZEND_VM_INC_OPCODE()\n"); + out($f,"# define SAVE_OPLINE()\n"); +- out($f,"# define SAVE_OPLINE_EX()\n"); + out($f,"#endif\n"); + out($f,"#undef HANDLE_EXCEPTION\n"); + out($f,"#undef HANDLE_EXCEPTION_LEAVE\n"); +@@ -2001,10 +1996,8 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name) + out($f,"#undef DCL_OPLINE\n"); + out($f,"#undef USE_OPLINE\n"); + out($f,"#undef LOAD_OPLINE\n"); +- out($f,"#undef LOAD_OPLINE_EX\n"); + out($f,"#undef LOAD_NEXT_OPLINE\n"); + out($f,"#undef SAVE_OPLINE\n"); +- out($f,"#undef SAVE_OPLINE_EX\n"); + out($f,"#define OPLINE opline\n"); + out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n"); + out($f,"# define DCL_OPLINE register const zend_op *opline __asm__(ZEND_VM_IP_GLOBAL_REG);\n"); +@@ -2013,10 +2006,8 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name) + out($f,"#endif\n"); + out($f,"#define USE_OPLINE\n"); + out($f,"#define LOAD_OPLINE() opline = EX(opline)\n"); +- out($f,"# define LOAD_OPLINE_EX() LOAD_OPLINE()\n"); + out($f,"#define LOAD_NEXT_OPLINE() opline = EX(opline) + 1\n"); + out($f,"#define SAVE_OPLINE() EX(opline) = opline\n"); +- out($f,"#define SAVE_OPLINE_EX()\n"); + out($f,"#undef HANDLE_EXCEPTION\n"); + out($f,"#undef HANDLE_EXCEPTION_LEAVE\n"); + out($f,"#define HANDLE_EXCEPTION() LOAD_OPLINE(); ZEND_VM_CONTINUE()\n"); +@@ -2037,10 +2028,8 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name) + out($f,"#undef DCL_OPLINE\n"); + out($f,"#undef USE_OPLINE\n"); + out($f,"#undef LOAD_OPLINE\n"); +- out($f,"#undef LOAD_OPLINE_EX\n"); + out($f,"#undef LOAD_NEXT_OPLINE\n"); + out($f,"#undef SAVE_OPLINE\n"); +- out($f,"#undef SAVE_OPLINE_EX\n"); + out($f,"#define OPLINE opline\n"); + out($f,"#ifdef ZEND_VM_IP_GLOBAL_REG\n"); + out($f,"# define DCL_OPLINE register const zend_op *opline __asm__(ZEND_VM_IP_GLOBAL_REG);\n"); +@@ -2049,10 +2038,8 @@ function gen_executor($f, $skl, $spec, $kind, $executor_name, $initializer_name) + out($f,"#endif\n"); + out($f,"#define USE_OPLINE\n"); + out($f,"#define LOAD_OPLINE() opline = EX(opline)\n"); +- out($f,"#define LOAD_OPLINE_EX() LOAD_OPLINE()\n"); + out($f,"#define LOAD_NEXT_OPLINE() opline = EX(opline) + 1\n"); + out($f,"#define SAVE_OPLINE() EX(opline) = opline\n"); +- out($f,"#define SAVE_OPLINE_EX()\n"); + out($f,"#undef HANDLE_EXCEPTION\n"); + out($f,"#undef HANDLE_EXCEPTION_LEAVE\n"); + if (ZEND_VM_SPEC) { +@@ -3072,18 +3059,14 @@ function gen_vm($def, $skel) { + out($f,"#undef DCL_OPLINE\n"); + out($f,"#undef USE_OPLINE\n"); + out($f,"#undef LOAD_OPLINE\n"); +- out($f,"#undef LOAD_OPLINE_EX\n"); + out($f,"#undef LOAD_NEXT_OPLINE\n"); + out($f,"#undef SAVE_OPLINE\n"); +- out($f,"#undef SAVE_OPLINE_EX\n"); + out($f,"#define OPLINE EX(opline)\n"); + out($f,"#define DCL_OPLINE\n"); + out($f,"#define USE_OPLINE const zend_op *opline = EX(opline);\n"); + out($f,"#define LOAD_OPLINE()\n"); +- out($f,"#define LOAD_OPLINE_EX()\n"); + out($f,"#define LOAD_NEXT_OPLINE() ZEND_VM_INC_OPCODE()\n"); + out($f,"#define SAVE_OPLINE()\n"); +- out($f,"#define SAVE_OPLINE_EX()\n"); + out($f,"#undef HANDLE_EXCEPTION\n"); + out($f,"#undef HANDLE_EXCEPTION_LEAVE\n"); + out($f,"#define HANDLE_EXCEPTION() LOAD_OPLINE(); ZEND_VM_CONTINUE()\n"); -- cgit