com php-src: Disable block pass for large functions: ext/opcache/Optimizer/block_pass.c
| From: | Nikita Popov | Date: | Tue, 28 Mar 2017 20:07:37 +0000 |
| Subject: | com php-src: Disable block pass for large functions: ext/opcache/Optimizer/block_pass.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-97429@lists.php.net to get a copy of this message | ||
Commit: d6f70f0ee3d5f595a9f6dadaabda834a1d47c662
Author: Nikita Popov <nikita.ppv@gmail.com> Fri, 17 Mar 2017 12:48:03 +0100
Parents: 5c93a31804fe7592d862c12eff15199c55058d72
Branches: PHP-7.0 PHP-7.1 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=d6f70f0ee3d5f595a9f6dadaabda834a1d47c662
Log:
Disable block pass for large functions
(Backport of 7ea261685f179a7cddcc4196fc7f3f12572c3d49 to 7.0.)
Changed paths:
M ext/opcache/Optimizer/block_pass.c
Diff:
diff --git a/ext/opcache/Optimizer/block_pass.c b/ext/opcache/Optimizer/block_pass.c
index f69199b..413b8b1 100644
--- a/ext/opcache/Optimizer/block_pass.c
+++ b/ext/opcache/Optimizer/block_pass.c
@@ -2000,6 +2000,10 @@ void optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx)
return;
}
+ if ((uint64_t) op_array->last * (op_array->last_var + op_array->T) > 512 * 1024 *
1024) {
+ return;
+ }
+
/* Build CFG */
checkpoint = zend_arena_checkpoint(ctx->arena);
if (!find_code_blocks(op_array, &cfg, ctx)) {