diff options
author | Nikita Popov <nikita.ppv@gmail.com> | 2017-03-17 12:48:03 +0100 |
---|---|---|
committer | Nikita Popov <nikita.ppv@gmail.com> | 2017-03-17 12:49:20 +0100 |
commit | 7ea261685f179a7cddcc4196fc7f3f12572c3d49 (patch) | |
tree | fbce0fa9a8a79e26e18b45ca7292921b23ffc028 | |
parent | 3becfb9be4cf4c6a465c6531621c3df5c358ba55 (diff) | |
download | php-git-7ea261685f179a7cddcc4196fc7f3f12572c3d49.tar.gz |
Disable block pass for large functions
This is the last fix for bug #74250.
-rw-r--r-- | NEWS | 4 | ||||
-rw-r--r-- | ext/opcache/Optimizer/block_pass.c | 5 |
2 files changed, 9 insertions, 0 deletions
@@ -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); } |