com php-src: We can't eliminate FETCH_CONSTANT opcodes fo r constants represented by AST.: ext/opcache/Opti mizer/pass1_5.c
| From: | Dmitry Stogov | Date: | Mon, 13 Oct 2014 10:07:37 +0000 |
| Subject: | com php-src: We can't eliminate FETCH_CONSTANT opcodes fo r constants represented by AST.: ext/opcache/Opti mizer/pass1_5.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-82261@lists.php.net to get a copy of this message | ||
Commit: 7acba332fe96e5da6ad3165d0699b9e4e65d94fa
Author: Dmitry Stogov <dmitry@zend.com> Mon, 13 Oct 2014 14:07:37 +0400
Parents: c96a6b44931ec54b95619d534be13a952189c4dc
Branches: PHP-5.6 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=7acba332fe96e5da6ad3165d0699b9e4e65d94fa
Log:
We can't eliminate FETCH_CONSTANT opcodes for constants represented by AST.
Changed paths:
M ext/opcache/Optimizer/pass1_5.c
Diff:
diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c
index 30705ff..41dde05 100644
--- a/ext/opcache/Optimizer/pass1_5.c
+++ b/ext/opcache/Optimizer/pass1_5.c
@@ -252,6 +252,9 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) {
break;
}
}
+ if (Z_TYPE(c) == IS_CONSTANT_AST) {
+ break;
+ }
literal_dtor(&ZEND_OP2_LITERAL(opline));
MAKE_NOP(opline);
replace_tmp_by_const(op_array, opline, tv, &c TSRMLS_CC);
@@ -303,6 +306,9 @@ if (ZEND_OPTIMIZER_PASS_1 & OPTIMIZATION_LEVEL) {
Z_STRVAL(ZEND_OP2_LITERAL(opline)),
Z_STRLEN(ZEND_OP2_LITERAL(opline)) + 1,
(void **) &c) == SUCCESS) {
+ if (Z_TYPE_PP(c) == IS_CONSTANT_AST) {
+ break;
+ }
if (ZEND_IS_CONSTANT_TYPE(Z_TYPE_PP(c))) {
if (!zend_get_persistent_constant(Z_STRVAL_PP(c), Z_STRLEN_PP(c), &t, 1 TSRMLS_CC) ||
ZEND_IS_CONSTANT_TYPE(Z_TYPE(t))) {