summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Popov <nikita.ppv@gmail.com>2017-03-17 12:48:03 +0100
committerNikita Popov <nikita.ppv@gmail.com>2017-03-17 12:49:20 +0100
commit7ea261685f179a7cddcc4196fc7f3f12572c3d49 (patch)
treefbce0fa9a8a79e26e18b45ca7292921b23ffc028
parent3becfb9be4cf4c6a465c6531621c3df5c358ba55 (diff)
downloadphp-git-7ea261685f179a7cddcc4196fc7f3f12572c3d49.tar.gz
Disable block pass for large functions
This is the last fix for bug #74250.
-rw-r--r--NEWS4
-rw-r--r--ext/opcache/Optimizer/block_pass.c5
2 files changed, 9 insertions, 0 deletions
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);
}