diff options
| author | Dmitry Stogov <dmitry@zend.com> | 2019-04-09 21:59:47 +0300 |
|---|---|---|
| committer | Dmitry Stogov <dmitry@zend.com> | 2019-04-09 21:59:47 +0300 |
| commit | 2980de29f0bf060f9e3f49f4fd101c7a80bffdba (patch) | |
| tree | 5341a3206f476554e0cad995b69013f07591d82b /ext | |
| parent | e640f64008237a9470344b84d5b2fc85470fee9d (diff) | |
| download | php-git-2980de29f0bf060f9e3f49f4fd101c7a80bffdba.tar.gz | |
Don't split basic block after RECV, if function checks type hints
Diffstat (limited to 'ext')
| -rw-r--r-- | ext/opcache/Optimizer/zend_dump.c | 3 | ||||
| -rw-r--r-- | ext/opcache/jit/zend_jit.c | 11 |
2 files changed, 13 insertions, 1 deletions
diff --git a/ext/opcache/Optimizer/zend_dump.c b/ext/opcache/Optimizer/zend_dump.c index 6f5d8ace18..ce002c644f 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 743bc7b432..847b6130e9 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; } |
