Skip to content

Commit 7ea2616

Browse files
committed
Disable block pass for large functions
This is the last fix for bug #74250.
1 parent 3becfb9 commit 7ea2616

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

NEWS

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,10 @@ PHP NEWS
1818
. Fixed bug #74004 (LIBXML_NOWARNING flag ingnored on loadHTML*).
1919
(somedaysummer)
2020

21+
- Opcache:
22+
. Fixed bug #74250 (OPcache compilation performance regression in PHP 5.6/7
23+
with huge classes). (Nikita)
24+
2125
- OpenSSL:
2226
. Fixed bug #72333 (fwrite() on non-blocking SSL sockets doesn't work).
2327
(Jakub Zelenka)

ext/opcache/Optimizer/block_pass.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1794,6 +1794,11 @@ void zend_optimize_cfg(zend_op_array *op_array, zend_optimizer_ctx *ctx)
17941794
return;
17951795
}
17961796

1797+
if (cfg.blocks_count * (op_array->last_var + op_array->T) > 64 * 1024 * 1024) {
1798+
zend_arena_release(&ctx->arena, checkpoint);
1799+
return;
1800+
}
1801+
17971802
if (ctx->debug_level & ZEND_DUMP_BEFORE_BLOCK_PASS) {
17981803
zend_dump_op_array(op_array, ZEND_DUMP_CFG, "before block pass", &cfg);
17991804
}

0 commit comments

Comments
 (0)