]> granicus.if.org Git - php/commitdiff
Merge branch 'PHP-5.6' into PHP-7.0
authorXinchen Hui <laruence@gmail.com>
Fri, 18 Dec 2015 09:41:42 +0000 (17:41 +0800)
committerXinchen Hui <laruence@gmail.com>
Fri, 18 Dec 2015 09:41:42 +0000 (17:41 +0800)
* PHP-5.6:
  Improved fix for #71127

Conflicts:
ext/opcache/Optimizer/pass1_5.c

1  2 
ext/opcache/Optimizer/pass1_5.c
ext/opcache/Optimizer/zend_optimizer.h

index 7e0d14ac608422708e764835016336738c2ea03f,4229f13ebeb4ddfa8d92754ae5093b5b3dd6cc36..24c28e976e88e6290538da2baf87490e78db57d1
@@@ -42,9 -16,8 +42,8 @@@ void zend_optimizer_pass1(zend_op_arra
        int i = 0;
        zend_op *opline = op_array->opcodes;
        zend_op *end = opline + op_array->last;
-       /* bug #71127*
-       zend_bool collect_constants = (op_array == &ctx->script->main_op_array); */
-       zend_bool collect_constants = 0;
+       zend_bool collect_constants = (ZEND_OPTIMIZER_PASS_15 & OPTIMIZATION_LEVEL)?
 -              (op_array == &script->main_op_array) : 0;
++              (op_array == &ctx->script->main_op_array) : 0;
  
        while (opline < end) {
                switch (opline->opcode) {
index 27c6159b7d1fc8fb4927eb1999cf332bca95a8a0,f4e441790f6a9446da896ff86c002cfd67390e8b..8c1b8eace877249f5e42967eb3c4e6fc4dd2cf0e
  #define ZEND_OPTIMIZER_PASS_9         (1<<8)   /* TMP VAR usage                */
  #define ZEND_OPTIMIZER_PASS_10                (1<<9)   /* NOP removal                 */
  #define ZEND_OPTIMIZER_PASS_11                (1<<10)  /* Merge equal constants       */
 -#define ZEND_OPTIMIZER_PASS_12                (1<<11)
 +#define ZEND_OPTIMIZER_PASS_12                (1<<11)  /* Adjust used stack           */
  #define ZEND_OPTIMIZER_PASS_13                (1<<12)
  #define ZEND_OPTIMIZER_PASS_14                (1<<13)
+ #define ZEND_OPTIMIZER_PASS_15                (1<<14)  /* Collect constants */
  
  #define ZEND_OPTIMIZER_ALL_PASSES     0xFFFFFFFF