com php-src: Allow removing of unused func_get_args() and func_get_num_args().: ext/opcache/Opti mizer/dce.c ext/opcache/Optimizer/zend_inference.c
| From: | Dmitry Stogov | Date: | Mon, 18 Sep 2017 11:37:51 +0000 |
| Subject: | com php-src: Allow removing of unused func_get_args() and func_get_num_args().: ext/opcache/Opti mizer/dce.c ext/opcache/Optimizer/zend_inference.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-99451@lists.php.net to get a copy of this message | ||
Commit: 8109ebbd053281f4cdb13960eac9bd9595442577
Author: Dmitry Stogov <dmitry@zend.com> Mon, 18 Sep 2017 14:37:51 +0300
Parents: fbe913d26d698d5da987c48a54d72ba92d1e0f82
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8109ebbd053281f4cdb13960eac9bd9595442577
Log:
Allow removing of unused func_get_args() and func_get_num_args().
Changed paths:
M ext/opcache/Optimizer/dce.c
M ext/opcache/Optimizer/zend_inference.c
Diff:
diff --git a/ext/opcache/Optimizer/dce.c b/ext/opcache/Optimizer/dce.c
index 21d99a8..ab2bc62 100644
--- a/ext/opcache/Optimizer/dce.c
+++ b/ext/opcache/Optimizer/dce.c
@@ -123,6 +123,8 @@ static inline zend_bool may_have_side_effects(
case ZEND_ISSET_ISEMPTY_VAR:
case ZEND_FETCH_IS:
case ZEND_IN_ARRAY:
+ case ZEND_FUNC_NUM_ARGS:
+ case ZEND_FUNC_GET_ARGS:
/* No side effects */
return 0;
case ZEND_JMP:
diff --git a/ext/opcache/Optimizer/zend_inference.c b/ext/opcache/Optimizer/zend_inference.c
index 5b6de7c..0d55280 100644
--- a/ext/opcache/Optimizer/zend_inference.c
+++ b/ext/opcache/Optimizer/zend_inference.c
@@ -4060,6 +4060,8 @@ int zend_may_throw(const zend_op *opline, zend_op_array *op_array, zend_ssa
*ssa
case ZEND_SWITCH_STRING:
case ZEND_ISSET_ISEMPTY_VAR:
case ZEND_ISSET_ISEMPTY_CV:
+ case ZEND_FUNC_NUM_ARGS:
+ case ZEND_FUNC_GET_ARGS:
return 0;
case ZEND_INIT_FCALL:
/* can't throw, because call is resolved at compile time */