com php-src: Merge branch 'PHP-5.6': ext/opcache/Optimizer/zend _optimizer.c

From: Date: Wed, 25 Feb 2015 12:16:15 +0000
Subject: com php-src: Merge branch 'PHP-5.6': ext/opcache/Optimizer/zend _optimizer.c
Groups: php.cvs 
Request: Send a blank email to php-cvs+get-85084@lists.php.net to get a copy of this message
Commit: 60f18026eb5f657a4cd9effa825be58848f56fc3 Author: Xinchen Hui <laruence@php.net> Wed, 25 Feb 2015 20:16:15 +0800 Parents: aadf7366e066a7c2c14e3098b1db5dc37783cff2 d3615b5fb1b4671af015b9ab9ee920fc069f21ee Branches: master Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=60f18026eb5f657a4cd9effa825be58848f56fc3 Log: Merge branch 'PHP-5.6' Conflicts: ext/opcache/Optimizer/zend_optimizer.c Changed paths: MM ext/opcache/Optimizer/zend_optimizer..c Diff: diff --cc ext/opcache/Optimizer/zend_optimizer.c index c9ee97f,08ce46c..62409e6 --- a/ext/opcache/Optimizer/zend_optimizer.c +++ b/ext/opcache/Optimizer/zend_optimizer.c @@@ -307,28 -325,22 +307,39 @@@ int zend_optimizer_replace_by_const(zen if (opline->extended_value & ZEND_ARG_SEND_BY_REF) { return 0; } - opline->extended_value = ZEND_DO_FCALL; + opline->extended_value = 0; + opline->opcode = ZEND_SEND_VAL_EX; } else { - opline->extended_value = ZEND_DO_FCALL_BY_NAME; + opline->extended_value = 0; + opline->opcode = ZEND_SEND_VAL; } - opline->opcode = ZEND_SEND_VAL; break; - case ZEND_SWITCH_FREE: + /* 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. + */ ++ case ZEND_FREE: case ZEND_CASE: { zend_op *m, *n; int brk = op_array->last_brk_cont; ++ zend_bool in_switch = 0; while (brk--) { if (op_array->brk_cont_array[brk].start <= (opline - op_array->opcodes) && op_array->brk_cont_array[brk].brk > (opline - op_array->opcodes)) { ++ in_switch = 1; break; } } ++ ++ if (!in_switch) { ++ ZEND_ASSERT(opline->opcode == ZEND_FREE); ++ MAKE_NOP(opline); ++ zval_dtor(val); ++ return 1; ++ } ++ m = opline; n = op_array->opcodes + op_array->brk_cont_array[brk].brk + 1; while (m < n) { @@@ -351,18 -363,18 +362,14 @@@ zval_dtor(val); return 1; } -- case ZEND_FREE: -- MAKE_NOP(opline); -- zval_dtor(val); - return 1; - break; default: break; - } - update_op1_const(op_array, opline, val TSRMLS_CC); + } + zend_optimizer_update_op1_const(op_array, opline, val); break; } - - if (ZEND_OP2_TYPE(opline) == IS_VAR && + + if (ZEND_OP2_TYPE(opline) == type && ZEND_OP2(opline).var == var) { switch (opline->opcode) { case ZEND_ASSIGN_REF:

« previous php.cvs (#85084) next »