From: Dmitry Stogov Date: Mon, 13 Oct 2014 10:07:37 +0000 (+0400) Subject: We can't eliminate FETCH_CONSTANT opcodes for constants represented by AST. X-Git-Tag: php-5.6.3RC1~59^2~21 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7acba332fe96e5da6ad3165d0699b9e4e65d94fa;p=php We can't eliminate FETCH_CONSTANT opcodes for constants represented by AST. --- diff --git a/ext/opcache/Optimizer/pass1_5.c b/ext/opcache/Optimizer/pass1_5.c index 30705ff18a..41dde05083 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))) {