Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge branch 'opcache' of ../php5.5

  • Loading branch information...
commit a4d214e4948d6d0b2aa7bdf014ef497546857d40 2 parents c046779 + 6c10ae4
@dstogov dstogov authored
Showing with 27 additions and 7 deletions.
  1. +25 −4 Optimizer/zend_optimizer.c
  2. +2 −3 config.w32
View
29 Optimizer/zend_optimizer.c
@@ -284,20 +284,41 @@ static void replace_tmp_by_const(zend_op_array *op_array,
if (ZEND_OP1_TYPE(opline) == IS_TMP_VAR &&
ZEND_OP1(opline).var == var) {
- update_op1_const(op_array, opline, val TSRMLS_CC);
- /* TMP_VAR my be used only once */
- break;
+ /* In most cases IS_TMP_VAR operand may be used only once.
+ * The operands are usually destroyed by the opcode handler.
+ * ZEND_CASE is an exception, that keeps operand unchanged,
+ * and allows its reuse. The number of ZEND_CASE instructions
+ * usually terminated by ZEND_FREE that finally kills the value.
+ */
+ if (opline->opcode == ZEND_CASE) {
+ zval old_val;
+ old_val = *val;
+ zval_copy_ctor(val);
+ update_op1_const(op_array, opline, val TSRMLS_CC);
+ *val = old_val;
+ } else if (opline->opcode == ZEND_FREE) {
+ MAKE_NOP(opline);
+ break;
+ } else {
+ update_op1_const(op_array, opline, val TSRMLS_CC);
+ val = NULL;
+ break;
+ }
}
if (ZEND_OP2_TYPE(opline) == IS_TMP_VAR &&
ZEND_OP2(opline).var == var) {
update_op2_const(op_array, opline, val TSRMLS_CC);
- /* TMP_VAR my be used only once */
+ /* TMP_VAR may be used only once */
+ val = NULL;
break;
}
opline++;
}
+ if (val) {
+ zval_dtor(val);
+ }
}
#include "Optimizer/nop_removal.c"
View
5 config.w32
@@ -1,9 +1,8 @@
ARG_ENABLE("opcache", "whether to enable Zend OPcache support", "yes");
-if (PHP_OPCACHE != "no") {
+var PHP_OPCACHE_PGO = false;
- PHP_PGI = "no"; // workaround
- PHP_PGO = "no"; // workaround
+if (PHP_OPCACHE != "no") {
EXTENSION('opcache', "\
ZendAccelerator.c \
Please sign in to comment.
Something went wrong with that request. Please try again.