com php-src: Don't split basic block after RECV, if function checks type hints: ext/opcache/Optimizer/zend_dump.c ext/opcache/jit/ zend_jit.c
| From: | Dmitry Stogov | Date: | Tue, 09 Apr 2019 18:59:47 +0000 |
| Subject: | com php-src: Don't split basic block after RECV, if function checks type hints: ext/opcache/Optimizer/zend_dump.c ext/opcache/jit/ zend_jit.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-105601@lists.php.net to get a copy of this message | ||
Commit: 2980de29f0bf060f9e3f49f4fd101c7a80bffdba
Author: Dmitry Stogov <dmitry@zend.com> Tue, 9 Apr 2019 21:59:47 +0300
Parents: e640f64008237a9470344b84d5b2fc85470fee9d
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=2980de29f0bf060f9e3f49f4fd101c7a80bffdba
Log:
Don't split basic block after RECV, if function checks type hints
Changed paths:
M ext/opcache/Optimizer/zend_dump.c
M ext/opcache/jit/zend_jit.c
Diff:
diff --git a/ext/opcache/Optimizer/zend_dump.c b/ext/opcache/Optimizer/zend_dump.c
index 6f5d8ac..ce002c6 100644
--- a/ext/opcache/Optimizer/zend_dump.c
+++ b/ext/opcache/Optimizer/zend_dump.c
@@ -732,6 +732,9 @@ static void zend_dump_block_info(const zend_cfg *cfg, int n, uint32_t dump_flags
if (b->flags & ZEND_BB_START) {
fprintf(stderr, " start");
}
+ if (b->flags & ZEND_BB_RECV_ENTRY) {
+ fprintf(stderr, " recv");
+ }
if (b->flags & ZEND_BB_FOLLOW) {
fprintf(stderr, " follow");
}
diff --git a/ext/opcache/jit/zend_jit.c b/ext/opcache/jit/zend_jit.c
index 743bc7b..847b613 100644
--- a/ext/opcache/jit/zend_jit.c
+++ b/ext/opcache/jit/zend_jit.c
@@ -591,7 +591,16 @@ static int zend_may_overflow(const zend_op *opline, zend_op_array *op_array,
zen
static int zend_jit_build_cfg(zend_op_array *op_array, zend_cfg *cfg)
{
- if (zend_build_cfg(&CG(arena), op_array, ZEND_CFG_STACKLESS | ZEND_CFG_RECV_ENTRY |
ZEND_RT_CONSTANTS | ZEND_CFG_NO_ENTRY_PREDECESSORS | ZEND_SSA_RC_INFERENCE_FLAG |
ZEND_SSA_USE_CV_RESULTS, cfg) != SUCCESS) {
+ uint32_t flags;
+
+ flags = ZEND_CFG_STACKLESS | ZEND_RT_CONSTANTS | ZEND_CFG_NO_ENTRY_PREDECESSORS |
ZEND_SSA_RC_INFERENCE_FLAG | ZEND_SSA_USE_CV_RESULTS;
+
+ if (!(op_array->fn_flags & ZEND_ACC_HAS_TYPE_HINTS)) {
+ /* First RECV/RECV_INIT instructions may be skipped */
+ flags |= ZEND_CFG_RECV_ENTRY;
+ }
+
+ if (zend_build_cfg(&CG(arena), op_array, flags, cfg) != SUCCESS) {
return FAILURE;
}