]> granicus.if.org Git - php/commitdiff
Disable block pass for large functions
authorNikita Popov <nikita.ppv@gmail.com>
Fri, 17 Mar 2017 11:48:03 +0000 (12:48 +0100)
committerNikita Popov <nikita.ppv@gmail.com>
Fri, 17 Mar 2017 11:49:20 +0000 (12:49 +0100)
This is the last fix for bug #74250.

NEWS
ext/opcache/Optimizer/block_pass.c

diff --git a/NEWS b/NEWS
index af21109b9596d170783b2399ea3224a3b9845fd0..a6e58aa677ad8361a9ecc11389cb164fcc28d9d8 100644 (file)
--- 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)
index a4f41368556aa321ad20ae01046fb590f48d1831..38c2ecb12440850ce63fd4c206f3b15ce9c67779 100644 (file)
@@ -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);
        }