PHP  
 PHP: Test and Code Coverage Analysis
downloads | QA | documentation | faq | getting help | mailing lists | reporting bugs | php.net sites | links | my php.net 
 

LCOV - code coverage report
Current view: top level - lcov_data/ext/opcache/Optimizer - pass3.c (source / functions) Hit Total Coverage
Test: PHP Code Coverage Lines: 0 160 0.0 %
Date: 2014-04-16 Functions: 0 0 -
Legend: Lines: hit not hit

          Line data    Source code
       1             : /* pass 3:
       2             :  * - optimize $i = $i+expr to $i+=expr
       3             :  * - optimize series of JMPs
       4             :  * - change $i++ to ++$i where possible
       5             :  */
       6             : 
       7             : /* compares opcodes with allowing oc1 be _EX of oc2 */
       8             : #define SAME_OPCODE_EX(oc1, oc2) ((oc1 == oc2) || (oc1 == ZEND_JMPZ_EX && oc2 == ZEND_JMPZ) || (oc1 == ZEND_JMPNZ_EX && oc2 == ZEND_JMPNZ))
       9             : 
      10             : /* we use "jmp_hitlist" to avoid infinity loops during jmp optimization */
      11             : #define CHECK_JMP(target, label)                        \
      12             :         for (i=0; i<jmp_hitlist_count; i++) {        \
      13             :                 if (jmp_hitlist[i] == ZEND_OP1(&op_array->opcodes[target]).opline_num) {         \
      14             :                         goto label;                                             \
      15             :                 }                                                                       \
      16             :         }                                                                               \
      17             :         jmp_hitlist[jmp_hitlist_count++] = ZEND_OP1(&op_array->opcodes[target]).opline_num;
      18             : 
      19             : #define CHECK_JMP2(target, label)                       \
      20             :         for (i=0; i<jmp_hitlist_count; i++) {        \
      21             :                 if (jmp_hitlist[i] == ZEND_OP2(&op_array->opcodes[target]).opline_num) {         \
      22             :                         goto label;                                             \
      23             :                 }                                                                       \
      24             :         }                                                                               \
      25             :         jmp_hitlist[jmp_hitlist_count++] = ZEND_OP2(&op_array->opcodes[target]).opline_num;
      26             : 
      27           0 : if (ZEND_OPTIMIZER_PASS_3 & OPTIMIZATION_LEVEL) {
      28             :         zend_op *opline;
      29           0 :         zend_op *end = op_array->opcodes + op_array->last;
      30             :         zend_uint *jmp_hitlist;
      31             :         int jmp_hitlist_count;
      32             :         int i;
      33           0 :         zend_uint opline_num = 0;
      34             :         ALLOCA_FLAG(use_heap);
      35             : 
      36           0 :         jmp_hitlist = (zend_uint *)DO_ALLOCA(sizeof(zend_uint)*op_array->last);
      37           0 :         opline = op_array->opcodes;
      38             : 
      39           0 :         while (opline < end) {
      40           0 :                 jmp_hitlist_count = 0;
      41             : 
      42           0 :                 switch (opline->opcode) {
      43             :                         case ZEND_ADD:
      44             :                         case ZEND_SUB:
      45             :                         case ZEND_MUL:
      46             :                         case ZEND_DIV:
      47             :                         case ZEND_MOD:
      48             :                         case ZEND_CONCAT:
      49             :                         case ZEND_SL:
      50             :                         case ZEND_SR:
      51             :                         case ZEND_BW_OR:
      52             :                         case ZEND_BW_AND:
      53             :                         case ZEND_BW_XOR:
      54             :                                 {
      55           0 :                                         zend_op *next_opline = opline + 1;
      56             : 
      57           0 :                                         while (next_opline < end && next_opline->opcode == ZEND_NOP) {
      58           0 :                                                 ++next_opline;
      59             :                                         }
      60             : 
      61           0 :                                         if (next_opline >= end || next_opline->opcode != ZEND_ASSIGN) {
      62             :                                                 break;
      63             :                                         }
      64             : 
      65           0 :                                         if ((ZEND_OP2_TYPE(opline) == IS_VAR || ZEND_OP2_TYPE(opline) == IS_CV)
      66           0 :                                                 && ZEND_OP2(opline).var == ZEND_OP1(next_opline).var &&
      67           0 :                                                 (opline->opcode == ZEND_ADD ||
      68           0 :                                                  opline->opcode == ZEND_MUL ||
      69           0 :                                                  opline->opcode == ZEND_BW_OR ||
      70           0 :                                                  opline->opcode == ZEND_BW_AND ||
      71           0 :                                                  opline->opcode == ZEND_BW_XOR)) {
      72             :                                                 /* change $i=expr+$i to $i=$i+expr so that the next
      73             :                                                 * optimization works on it
      74             :                                                 */
      75             : #if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO
      76           0 :                                                 zend_uchar tmp_type = opline->op1_type;
      77           0 :                                                 znode_op tmp = opline->op1;
      78             : #else
      79             :                                                 znode tmp = opline->op1;
      80             : #endif
      81             : 
      82           0 :                                                 if (opline->opcode != ZEND_ADD || ZEND_OP1_TYPE(opline) == IS_CONST) {
      83             :                                                         /* protection from array add: $a = array + $a is not commutative! */
      84           0 :                                                         COPY_NODE(opline->op1, opline->op2);
      85           0 :                                                         COPY_NODE(opline->op2, tmp);
      86             :                                                 }
      87             :                                         }
      88           0 :                                         if ((ZEND_OP1_TYPE(opline) == IS_VAR || ZEND_OP1_TYPE(opline) == IS_CV)
      89             :                                                 && ZEND_OP1(opline).var == ZEND_OP1(next_opline).var
      90           0 :                                                 && ZEND_OP1_TYPE(opline) == ZEND_OP1_TYPE(next_opline)) {
      91           0 :                                                 switch (opline->opcode) {
      92             :                                                         case ZEND_ADD:
      93           0 :                                                                 opline->opcode = ZEND_ASSIGN_ADD;
      94           0 :                                                                 break;
      95             :                                                         case ZEND_SUB:
      96           0 :                                                                 opline->opcode = ZEND_ASSIGN_SUB;
      97           0 :                                                                 break;
      98             :                                                         case ZEND_MUL:
      99           0 :                                                                 opline->opcode = ZEND_ASSIGN_MUL;
     100           0 :                                                                 break;
     101             :                                                         case ZEND_DIV:
     102           0 :                                                                 opline->opcode = ZEND_ASSIGN_DIV;
     103           0 :                                                                 break;
     104             :                                                         case ZEND_MOD:
     105           0 :                                                                 opline->opcode = ZEND_ASSIGN_MOD;
     106           0 :                                                                 break;
     107             :                                                         case ZEND_CONCAT:
     108           0 :                                                                 opline->opcode = ZEND_ASSIGN_CONCAT;
     109           0 :                                                                 break;
     110             :                                                         case ZEND_SL:
     111           0 :                                                                 opline->opcode = ZEND_ASSIGN_SL;
     112           0 :                                                                 break;
     113             :                                                         case ZEND_SR:
     114           0 :                                                                 opline->opcode = ZEND_ASSIGN_SR;
     115           0 :                                                                 break;
     116             :                                                         case ZEND_BW_OR:
     117           0 :                                                                 opline->opcode = ZEND_ASSIGN_BW_OR;
     118           0 :                                                                 break;
     119             :                                                         case ZEND_BW_AND:
     120           0 :                                                                 opline->opcode = ZEND_ASSIGN_BW_AND;
     121           0 :                                                                 break;
     122             :                                                         case ZEND_BW_XOR:
     123           0 :                                                                 opline->opcode = ZEND_ASSIGN_BW_XOR;
     124             :                                                                 break;
     125             :                                                 }
     126           0 :                                                 COPY_NODE(opline->result, next_opline->result);
     127           0 :                                                 MAKE_NOP(next_opline);
     128           0 :                                                 opline++;
     129           0 :                                                 opline_num++;
     130             :                                         }
     131             :                                 }
     132           0 :                                 break;
     133             : 
     134             :                         case ZEND_JMP:
     135             : #if ZEND_EXTENSION_API_NO > PHP_5_4_X_API_NO
     136           0 :                                 if (op_array->has_finally_block) {
     137           0 :                                         break;
     138             :                                 }
     139             : #endif
     140             : 
     141             :                                 /* convert L: JMP L+1 to NOP */
     142           0 :                                 if (ZEND_OP1(opline).opline_num == opline_num + 1) {
     143           0 :                                         MAKE_NOP(opline);
     144           0 :                                         goto done_jmp_optimization;
     145             :                                 }
     146             : 
     147             :                                 /* convert JMP L1 ... L1: JMP L2 to JMP L2 .. L1: JMP L2 */
     148           0 :                                 while (ZEND_OP1(opline).opline_num < op_array->last
     149           0 :                                                 && op_array->opcodes[ZEND_OP1(opline).opline_num].opcode == ZEND_JMP) {
     150           0 :                                         int target = ZEND_OP1(opline).opline_num;
     151           0 :                                         CHECK_JMP(target, done_jmp_optimization);
     152           0 :                                         ZEND_OP1(opline).opline_num = ZEND_OP1(&op_array->opcodes[target]).opline_num;
     153             :                                 }
     154           0 :                                 break;
     155             : 
     156             : #if ZEND_EXTENSION_API_NO >= PHP_5_3_X_API_NO
     157             :                         case ZEND_JMP_SET:
     158             : #if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO
     159             :                         case ZEND_JMP_SET_VAR:
     160             : #endif
     161             : 
     162             : #if ZEND_EXTENSION_API_NO > PHP_5_4_X_API_NO
     163           0 :                                 if (op_array->has_finally_block) {
     164           0 :                                         break;
     165             :                                 }
     166             : #endif
     167             : 
     168           0 :                                 while (ZEND_OP2(opline).opline_num < op_array->last) {
     169           0 :                                         int target = ZEND_OP2(opline).opline_num;
     170           0 :                                         if (op_array->opcodes[target].opcode == ZEND_JMP) {
     171           0 :                                                 ZEND_OP2(opline).opline_num = ZEND_OP1(&op_array->opcodes[target]).opline_num;
     172             :                                         } else {
     173           0 :                                                 break;
     174             :                                         }
     175             :                                 }
     176           0 :                                 break;
     177             : #endif
     178             : 
     179             :                         case ZEND_JMPZ:
     180             :                         case ZEND_JMPNZ:
     181             : #if ZEND_EXTENSION_API_NO > PHP_5_4_X_API_NO
     182           0 :                                 if (op_array->has_finally_block) {
     183           0 :                                         break;
     184             :                                 }
     185             : #endif
     186             : 
     187             :                                 /* convert L: JMPZ L+1 to NOP */
     188           0 :                                 if (ZEND_OP2(opline).opline_num == opline_num + 1) {
     189           0 :                                         MAKE_NOP(opline);
     190           0 :                                         goto done_jmp_optimization;
     191             :                                 }
     192             : 
     193           0 :                                 while (ZEND_OP2(opline).opline_num < op_array->last) {
     194           0 :                                         int target = ZEND_OP2(opline).opline_num;
     195             : 
     196           0 :                                         if (op_array->opcodes[target].opcode == ZEND_JMP) {
     197             :                                                 /* plain JMP */
     198             :                                                 /* JMPZ(X,L1), L1: JMP(L2) => JMPZ(X,L2), L1: JMP(L2) */
     199           0 :                                                 CHECK_JMP(target, done_jmp_optimization);
     200           0 :                                                 ZEND_OP2(opline).opline_num = ZEND_OP1(&op_array->opcodes[target]).opline_num;
     201           0 :                                         } else if (op_array->opcodes[target].opcode == opline->opcode &&
     202           0 :                                                    SAME_VAR(opline->op1, op_array->opcodes[target].op1)) {
     203             :                                                 /* same opcode and same var as this opcode */
     204             :                                                 /* JMPZ(X,L1), L1: JMPZ(X,L2) => JMPZ(X,L2), L1: JMPZ(X,L2) */
     205           0 :                                                 CHECK_JMP2(target, done_jmp_optimization);
     206           0 :                                                 ZEND_OP2(opline).opline_num = ZEND_OP2(&op_array->opcodes[target]).opline_num;
     207           0 :                                         } else if (op_array->opcodes[target].opcode == opline->opcode + 3 &&
     208           0 :                                                    SAME_VAR(opline->op1, op_array->opcodes[target].op1)) {
     209             :                                                 /* convert JMPZ(X,L1), L1: T JMPZ_EX(X,L2) to
     210             :                                                    T = JMPZ_EX(X, L2) */
     211           0 :                                                 ZEND_OP2(opline).opline_num = ZEND_OP2(&op_array->opcodes[target]).opline_num;opline->opcode += 3;
     212           0 :                                                 COPY_NODE(opline->result, op_array->opcodes[target].result);
     213           0 :                                                 break;
     214           0 :                                         } else if (op_array->opcodes[target].opcode == INV_COND(opline->opcode) &&
     215           0 :                                                    SAME_VAR(opline->op1, op_array->opcodes[target].op1)) {
     216             :                                                 /* convert JMPZ(X,L1), L1: JMPNZ(X,L2) to
     217             :                                                    JMPZ(X,L1+1) */
     218           0 :                                                 ZEND_OP2(opline).opline_num = target + 1;
     219           0 :                                                 break;
     220           0 :                                         } else if (op_array->opcodes[target].opcode == INV_COND_EX(opline->opcode) &&
     221           0 :                                                    SAME_VAR(opline->op1, op_array->opcodes[target].op1)) {
     222             :                                                 /* convert JMPZ(X,L1), L1: T = JMPNZ_EX(X,L2) to
     223             :                                                    T = JMPZ_EX(X,L1+1) */
     224           0 :                                                 ZEND_OP2(opline).opline_num = target + 1;
     225           0 :                                                 opline->opcode += 3;
     226           0 :                                                 COPY_NODE(opline->result, op_array->opcodes[target].result);
     227           0 :                                                 break;
     228             :                                         } else {
     229             :                                                 break;
     230             :                                         }
     231             :                                 }
     232           0 :                                 break;
     233             : 
     234             :                         case ZEND_JMPZ_EX:
     235             :                         case ZEND_JMPNZ_EX: {
     236             : #if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO
     237           0 :                                         zend_uchar T_type = opline->result_type;
     238           0 :                                         znode_op T = opline->result;
     239             : #else
     240             :                                         znode T = opline->result;
     241             : #endif
     242             : #if ZEND_EXTENSION_API_NO > PHP_5_4_X_API_NO
     243           0 :                                         if (op_array->has_finally_block) {
     244           0 :                                                 break;
     245             :                                         }
     246             : #endif
     247             :                                         /* convert L: T = JMPZ_EX X,L+1 to T = BOOL(X) */
     248             :                                         /* convert L: T = JMPZ_EX T,L+1 to NOP */
     249           0 :                                         if (ZEND_OP2(opline).opline_num == opline_num + 1) {
     250           0 :                                                 if (ZEND_OP1(opline).var == ZEND_RESULT(opline).var) {
     251           0 :                                                         MAKE_NOP(opline);
     252             :                                                 } else {
     253           0 :                                                         opline->opcode = ZEND_BOOL;
     254           0 :                                                         SET_UNUSED(opline->op2);
     255             :                                                 }
     256           0 :                                                 goto done_jmp_optimization;
     257             :                                         }
     258             : 
     259           0 :                                         while (ZEND_OP2(opline).opline_num < op_array->last) {
     260           0 :                                                 int target = ZEND_OP2(opline).opline_num;
     261           0 :                                                 if (SAME_OPCODE_EX(opline->opcode, op_array->opcodes[target].opcode) &&
     262           0 :                                                         SAME_VAR(op_array->opcodes[target].op1, T)) {
     263             :                                                         /* Check for JMPZ_EX to JMPZ[_EX] with the same condition, either with _EX or not */
     264           0 :                                                         if (op_array->opcodes[target].opcode == opline->opcode) {
     265             :                                                                 /* change T only if we have _EX opcode there */
     266           0 :                                                                 COPY_NODE(T, op_array->opcodes[target].result);
     267             :                                                         }
     268           0 :                                                         CHECK_JMP2(target, continue_jmp_ex_optimization);
     269           0 :                                                         ZEND_OP2(opline).opline_num = ZEND_OP2(&op_array->opcodes[target]).opline_num;
     270           0 :                                                 } else if (op_array->opcodes[target].opcode == ZEND_JMPZNZ &&
     271           0 :                                                                   SAME_VAR(op_array->opcodes[target].op1, T)) {
     272             :                                                         /* Check for JMPZNZ with same cond variable */
     273             :                                                         int new_target;
     274           0 :                                                         CHECK_JMP2(target, continue_jmp_ex_optimization);
     275           0 :                                                         if (opline->opcode == ZEND_JMPZ_EX) {
     276           0 :                                                                 new_target = ZEND_OP2(&op_array->opcodes[target]).opline_num;
     277             :                                                         } else {
     278             :                                                                 /* JMPNZ_EX */
     279           0 :                                                                 new_target = op_array->opcodes[target].extended_value;
     280             :                                                         }
     281           0 :                                                         ZEND_OP2(opline).opline_num = new_target;
     282           0 :                                                 } else if ((op_array->opcodes[target].opcode == INV_EX_COND_EX(opline->opcode) ||
     283           0 :                                                                         op_array->opcodes[target].opcode == INV_EX_COND(opline->opcode)) &&
     284           0 :                                                                         SAME_VAR(opline->op1, op_array->opcodes[target].op1)) {
     285             :                                                    /* convert JMPZ_EX(X,L1), L1: JMPNZ_EX(X,L2) to
     286             :                                                           JMPZ_EX(X,L1+1) */
     287           0 :                                                    ZEND_OP2(opline).opline_num = target + 1;
     288           0 :                                                    break;
     289             :                                                 } else {
     290             :                                                         break;
     291             :                                                 }
     292             :                                         } /* while */
     293             : continue_jmp_ex_optimization:
     294           0 :                                         break;
     295             : #if 0
     296             :                                         /* If Ti = JMPZ_EX(X, L) and Ti is not used, convert to JMPZ(X, L) */
     297             :                                         {
     298             :                                                 zend_op *op;
     299             :                                                 for(op = opline+1; op<end; op++) {
     300             :                                                         if(ZEND_RESULT_TYPE(op) == IS_TMP_VAR &&
     301             :                                                            ZEND_RESULT(op).var == ZEND_RESULT(opline).var) {
     302             :                                                                 break; /* can pass to part 2 */
     303             :                                                         }
     304             : 
     305             :                                                         if(op->opcode == ZEND_JMP ||
     306             :                                                            op->opcode == ZEND_JMPZ ||
     307             :                                                            op->opcode == ZEND_JMPZ_EX ||
     308             :                                                            op->opcode == ZEND_JMPNZ ||
     309             :                                                            op->opcode == ZEND_JMPNZ_EX ||
     310             :                                                            op->opcode == ZEND_JMPZNZ ||
     311             :                                                            op->opcode == ZEND_BRK ||
     312             :                                                            op->opcode == ZEND_CONT ||
     313             :                                                            op->opcode == ZEND_CASE ||
     314             :                                                            op->opcode == ZEND_RETURN ||
     315             : #if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO
     316             :                                                            op->opcode == ZEND_RETURN_BY_REF ||
     317             : #endif
     318             : #if ZEND_EXTENSION_API_NO > PHP_5_4_X_API_NO
     319             :                                                            op->opcode == ZEND_FAST_RET ||
     320             : #endif
     321             :                                                            op->opcode == ZEND_FE_FETCH ||
     322             :                                                            op->opcode == ZEND_EXIT) {
     323             :                                                                 break;
     324             :                                                         }
     325             : 
     326             :                                                         if(ZEND_OP1_TYPE(op) == IS_TMP_VAR &&
     327             :                                                            ZEND_OP1(op).var == ZEND_RESULT(opline).var) {
     328             :                                                                 goto done_jmp_optimization;
     329             :                                                         }
     330             : 
     331             :                                                         if(ZEND_OP2_TYPE(op) == IS_TMP_VAR &&
     332             :                                                            ZEND_OP2(op).var == ZEND_RESULT(opline).var) {
     333             :                                                                 goto done_jmp_optimization;
     334             :                                                         }
     335             :                                                 } /* for */
     336             : 
     337             :                                                 for(op = &op_array->opcodes[ZEND_OP2(opline).opline_num]; op<end; op++) {
     338             : 
     339             :                                                         if(ZEND_RESULT_TYPE(op) == IS_TMP_VAR &&
     340             :                                                            ZEND_RESULT(op).var == ZEND_RESULT(opline).var) {
     341             :                                                                 break; /* can pass to optimization */
     342             :                                                         }
     343             : 
     344             :                                                         if(op->opcode == ZEND_JMP ||
     345             :                                                            op->opcode == ZEND_JMPZ ||
     346             :                                                            op->opcode == ZEND_JMPZ_EX ||
     347             :                                                            op->opcode == ZEND_JMPNZ ||
     348             :                                                            op->opcode == ZEND_JMPNZ_EX ||
     349             :                                                            op->opcode == ZEND_JMPZNZ ||
     350             :                                                            op->opcode == ZEND_BRK ||
     351             :                                                            op->opcode == ZEND_CONT ||
     352             :                                                            op->opcode == ZEND_CASE ||
     353             :                                                            op->opcode == ZEND_RETURN ||
     354             : #if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO
     355             :                                                            op->opcode == ZEND_RETURN_BY_REF ||
     356             : #endif
     357             : #if ZEND_EXTENSION_API_NO > PHP_5_4_X_API_NO
     358             :                                                            op->opcode == ZEND_FAST_RET ||
     359             : #endif
     360             :                                                            op->opcode == ZEND_FE_FETCH ||
     361             :                                                            op->opcode == ZEND_EXIT) {
     362             :                                                                 break;
     363             :                                                         }
     364             : 
     365             :                                                         if(ZEND_OP1_TYPE(op) == IS_TMP_VAR &&
     366             :                                                            ZEND_OP1(op).var == ZEND_RESULT(opline).var) {
     367             :                                                                 goto done_jmp_optimization;
     368             :                                                         }
     369             : 
     370             :                                                         if(ZEND_OP2_TYPE(op) == IS_TMP_VAR &&
     371             :                                                            ZEND_OP2(op).var == ZEND_RESULT(opline).var) {
     372             :                                                                 goto done_jmp_optimization;
     373             :                                                         }
     374             :                                                 }
     375             : 
     376             :                                                 opline->opcode = opline->opcode-3; /* JMP_EX -> JMP */
     377             :                                                 SET_UNUSED(opline->result);
     378             :                                                 break;
     379             :                                         }
     380             : #endif
     381             :                                 }
     382             :                                 break;
     383             : 
     384             :                         case ZEND_JMPZNZ:
     385             : #if ZEND_EXTENSION_API_NO > PHP_5_4_X_API_NO
     386           0 :                                 if (op_array->has_finally_block) {
     387           0 :                                         break;
     388             :                                 }
     389             : #endif
     390             :                                 /* JMPZNZ(X,L1,L2), L1: JMP(L3) => JMPZNZ(X,L3,L2), L1: JMP(L3) */
     391           0 :                                 while (ZEND_OP2(opline).opline_num < op_array->last
     392           0 :                                                 && op_array->opcodes[ZEND_OP2(opline).opline_num].opcode == ZEND_JMP) {
     393           0 :                                         int target = ZEND_OP2(opline).opline_num;
     394           0 :                                         CHECK_JMP(target, continue_jmpznz_optimization);
     395           0 :                                         ZEND_OP2(opline).opline_num = ZEND_OP1(&op_array->opcodes[target]).opline_num;
     396             :                                 }
     397             : continue_jmpznz_optimization:
     398             :                                 /* JMPZNZ(X,L1,L2), L2: JMP(L3) => JMPZNZ(X,L1,L3), L2: JMP(L3) */
     399           0 :                                 while (opline->extended_value < op_array->last
     400           0 :                                                 && op_array->opcodes[opline->extended_value].opcode == ZEND_JMP) {
     401           0 :                                         int target = opline->extended_value;
     402           0 :                                         CHECK_JMP(target, done_jmp_optimization);
     403           0 :                                         opline->extended_value = ZEND_OP1(&op_array->opcodes[target]).opline_num;
     404             :                                 }
     405           0 :                                 break;
     406             : 
     407             :                         case ZEND_POST_INC:
     408             :                         case ZEND_POST_DEC: {
     409             :                                         /* POST_INC, FREE => PRE_INC */
     410           0 :                                         zend_op *next_op = opline + 1;
     411             : 
     412           0 :                                         if (next_op >= end) {
     413           0 :                                                 break;
     414             :                                         }
     415           0 :                                         if (next_op->opcode == ZEND_FREE &&
     416           0 :                                                 ZEND_OP1(next_op).var == ZEND_RESULT(opline).var) {
     417           0 :                                                 MAKE_NOP(next_op);
     418           0 :                                                 switch (opline->opcode) {
     419             :                                                         case ZEND_POST_INC:
     420           0 :                                                                 opline->opcode = ZEND_PRE_INC;
     421           0 :                                                                 break;
     422             :                                                         case ZEND_POST_DEC:
     423           0 :                                                                 opline->opcode = ZEND_PRE_DEC;
     424             :                                                                 break;
     425             :                                                 }
     426             : #if ZEND_EXTENSION_API_NO > PHP_5_3_X_API_NO
     427           0 :                                                 ZEND_RESULT_TYPE(opline) = IS_VAR | EXT_TYPE_UNUSED;
     428             : #else
     429             :                                                 ZEND_RESULT_TYPE(opline) = IS_VAR;
     430             :                                                 ZEND_RESULT(opline).EA.type = 0;
     431             :                                                 ZEND_RESULT(opline).EA.type |= EXT_TYPE_UNUSED;
     432             : #endif
     433             :                                         }
     434             :                                 }
     435             :                                 break;
     436             :                 }
     437             : done_jmp_optimization:
     438           0 :                 opline++;
     439           0 :                 opline_num++;
     440             :         }
     441           0 :         FREE_ALLOCA(jmp_hitlist);
     442             : }

Generated by: LCOV version 1.10

Generated at Wed, 16 Apr 2014 12:48:02 +0000 (23 hours ago)

Copyright © 2005-2014 The PHP Group
All rights reserved.