com php-src: Escpaing objects can't have destructors, so their assignment don't make side effects and may be eliminated.: ext/opcache/Optimizer/dce.c
| From: | Dmitry Stogov | Date: | Tue, 29 Aug 2017 08:54:00 +0000 |
| Subject: | com php-src: Escpaing objects can't have destructors, so their assignment don't make side effects and may be eliminated.: ext/opcache/Optimizer/dce.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-99184@lists.php.net to get a copy of this message | ||
Commit: 37adfcce8b91ad5fd2516bab357b34e91645da36
Author: Dmitry Stogov <dmitry@zend.com> Tue, 29 Aug 2017 11:54:00 +0300
Parents: 177816900802eb12e729f61ae87bdcd6104f0f84
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=37adfcce8b91ad5fd2516bab357b34e91645da36
Log:
Escpaing objects can't have destructors, so their assignment don't make side effects and
may be eliminated.
Changed paths:
M ext/opcache/Optimizer/dce.c
Diff:
diff --git a/ext/opcache/Optimizer/dce.c b/ext/opcache/Optimizer/dce.c
index 0a0166b..998993d 100644
--- a/ext/opcache/Optimizer/dce.c
+++ b/ext/opcache/Optimizer/dce.c
@@ -166,7 +166,9 @@ static inline zend_bool may_have_side_effects(
return 1;
}
if (!reorder_dtor_effects) {
- if (opline->op2_type != IS_CONST && (OP2_INFO() & MAY_HAVE_DTOR)) {
+ if (opline->op2_type != IS_CONST
+ && (OP2_INFO() & MAY_HAVE_DTOR)
+ && ssa->vars[ssa_op->op2_use].escape_state != ESCAPE_STATE_NO_ESCAPE) {
/* DCE might shorten lifetime */
return 1;
}
@@ -215,7 +217,10 @@ static inline zend_bool may_have_side_effects(
}
if (!reorder_dtor_effects) {
opline++;
- if (opline->op1_type != IS_CONST && (OP1_INFO() & MAY_HAVE_DTOR)) {
+ ssa_op++;
+ if (opline->op1_type != IS_CONST
+ && (OP1_INFO() & MAY_HAVE_DTOR)
+ && ssa->vars[ssa_op->op1_use].escape_state != ESCAPE_STATE_NO_ESCAPE) {
/* DCE might shorten lifetime */
return 1;
}