From: Nikita Popov Date: Fri, 17 Mar 2017 11:48:03 +0000 (+0100) Subject: Disable block pass for large functions X-Git-Tag: php-7.1.4RC1~25 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7ea261685f179a7cddcc4196fc7f3f12572c3d49;p=php Disable block pass for large functions This is the last fix for bug #74250. --- diff --git a/NEWS b/NEWS index af21109b95..a6e58aa677 100644 --- a/NEWS +++ b/NEWS @@ -18,6 +18,10 @@ PHP NEWS . Fixed bug #74004 (LIBXML_NOWARNING flag ingnored on loadHTML*). (somedaysummer) +- Opcache: + . Fixed bug #74250 (OPcache compilation performance regression in PHP 5.6/7 + with huge classes). (Nikita) + - OpenSSL: . Fixed bug #72333 (fwrite() on non-blocking SSL sockets doesn't work). (Jakub Zelenka) diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c index a4f4136855..38c2ecb124 100644 --- a/ext/opcache/Optimizer/block_pass.c +++ b/ext/opcache/Optimizer/block_pass.c @@ -1794,6 +1794,11 @@ void zend_optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx) return; } + if (cfg.blocks_count * (op_array->last_var + op_array->T) > 64 * 1024 * 1024) { + zend_arena_release(&ctx->arena, checkpoint); + return; + } + if (ctx->debug_level & ZEND_DUMP_BEFORE_BLOCK_PASS) { zend_dump_op_array(op_array, ZEND_DUMP_CFG, "before block pass", &cfg); }