Changeset 309


Ignore:
Timestamp:
05/10/07 23:30:16 (3 years ago)
Author:
bart
Message:

Commit patch from ticket #252: Don't make eA stop init of php when eA fails.

Location:
eaccelerator/trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • eaccelerator/trunk/eaccelerator.c

    r308 r309  
    17491749      ret = 1; 
    17501750    } else { 
    1751       zend_error(E_CORE_WARNING,"[%s] This build of \"%s\" was compiled for PHP version %s. Rebuild it for your PHP version (%s) or download precompiled binaries.\n", EACCELERATOR_EXTENSION_NAME,EACCELERATOR_EXTENSION_NAME,PHP_VERSION,Z_STRVAL(v)); 
     1751      ea_debug_error("[%s] This build of \"%s\" was compiled for PHP version %s. Rebuild it for your PHP version (%s) or download precompiled binaries.\n",  
     1752                                        EACCELERATOR_EXTENSION_NAME, EACCELERATOR_EXTENSION_NAME,PHP_VERSION,Z_STRVAL(v)); 
    17521753    } 
    17531754    zval_dtor(&v); 
    17541755  } else { 
    1755     zend_error(E_CORE_WARNING,"[%s] This build of \"%s\" was compiled for PHP version %s. Rebuild it for your PHP version.\n", EACCELERATOR_EXTENSION_NAME,EACCELERATOR_EXTENSION_NAME,PHP_VERSION); 
     1756    ea_debug_error("[%s] This build of \"%s\" was compiled for PHP version %s. Rebuild it for your PHP version.\n", 
     1757                                EACCELERATOR_EXTENSION_NAME, EACCELERATOR_EXTENSION_NAME, PHP_VERSION); 
    17561758  } 
    17571759  return ret; 
     
    17921794  } 
    17931795  if (!eaccelerator_check_php_version(TSRMLS_C)) { 
    1794     return FAILURE; 
     1796    /*  
     1797                 * do not return FAILURE, because it causes PHP to completely fail. 
     1798                 * Just disable eAccelerator instead of making eA fail starting php 
     1799                 */ 
     1800    return SUCCESS; 
    17951801  } 
    17961802  ZEND_INIT_MODULE_GLOBALS(eaccelerator, eaccelerator_init_globals, NULL); 
  • eaccelerator/trunk/optimize.c

    r286 r309  
    2828#include "eaccelerator.h" 
    2929 
    30 #ifdef HAVE_EACCELERATOR 
    31 #ifdef WITH_EACCELERATOR_OPTIMIZER 
     30//#ifdef HAVE_EACCELERATOR 
     31//#ifdef WITH_EACCELERATOR_OPTIMIZER 
    3232 
    3333#include "zend.h" 
     
    4646  /* 
    4747   * HOESH: To protect merging. Primary 
    48    * it abblies to try & catch blocks. 
     48   * it applies to try & catch blocks. 
    4949   * ZEND_ENGINE_2 specific, but can take place 
    5050   */ 
     
    6363} BBlink; 
    6464 
    65 #if 0 
    6665static void dump_bb(BB* bb, zend_op_array *op_array) { 
    6766  BB* p = bb; 
     
    6968  zend_printf("<pre>%s:%s\n", op_array->filename, op_array->function_name); 
    7069  while (p != NULL) { 
    71     zend_printf("  bb%u start=%u len=%d used=%d\n", 
     70    zend_printf("  <strong>bb%u</strong> start=%u len=%d used=%d protected=%d\n", 
    7271                 (unsigned int)(p-bb), 
    7372                 (unsigned int)(p->start-op_array->opcodes), 
    7473                 p->len, 
    75                  p->used); 
     74                 p->used, 
     75                 p->protect_merge); 
    7676    if (p->jmp_1) { 
    7777      zend_printf("    jmp_1 bb%u start=%u  len=%d used=%d\n", 
     
    168168   zend_printf("<br>\n"); 
    169169} 
    170 #endif 
    171170 
    172171#define SET_TO_NOP(op) \ 
     
    249248#ifdef ZEND_ENGINE_2 
    250249             (end->opcode == ZEND_RECV || end->opcode == ZEND_RECV_INIT || 
    251               (end->result.u.EA.type & EXT_TYPE_UNUSED) == 0)) || 
     250             (end->result.u.EA.type & EXT_TYPE_UNUSED) == 0)) || 
    252251#else 
    253252             (end->result.u.EA.type & EXT_TYPE_UNUSED) == 0) || 
    254253#endif 
    255254             (end->result.op_type == IS_TMP_VAR)) && 
    256             !global[VAR_NUM(end->result.u.var)] && !used[VAR_NUM(end->result.u.var)]) { 
     255             !global[VAR_NUM(end->result.u.var)] && !used[VAR_NUM(end->result.u.var)]) { 
    257256           switch(end->opcode) { 
    258257             case ZEND_JMPZ_EX: 
     
    549548    p = bb; 
    550549    while (p->next != NULL) { 
    551       if (p->next->used && p->next->pred) { 
     550      if (p->next->used && (p->next->pred || p->protect_merge)) { 
    552551        p = p->next; 
    553552      } else { 
     
    581580    p = bb; 
    582581    while (p != NULL) { 
    583       while (p->next != NULL && (!p->next->used || p->next->pred == NULL)) { 
     582      while (p->next != NULL && (!p->next->used || p->next->pred == NULL) && !p->protect_merge) { 
    584583        del_bb(p->next); 
    585584        p->next = p->next->next; 
     
    27152714                        bb[tc_element->catch_op].start = &op_array->opcodes[tc_element->catch_op]; 
    27162715                        bb[tc_element->catch_op].protect_merge = 1; 
     2716            bb[tc_element->catch_op].used = 1; 
    27172717                } 
    27182718        } 
     2719     
     2720    dump_bb(bb, op_array); 
     2721     
    27192722#endif 
    27202723        /* Find Starts of Basic Blocks */ 
     
    31753178#define FREE_REG(R) reg_pool[(R)] = 0; 
    31763179 
    3177  
    3178 void reassign_registers(zend_op_array *op_array, BB* p, char *global) { 
     3180static void reassign_registers(zend_op_array *op_array, BB* p, char *global) { 
    31793181  zend_uint i; 
    31803182  zend_uint n = 0; 
     
    32983300} 
    32993301 
    3300 void restore_operand_types(zend_op_array *op_array) { 
     3302static void restore_operand_types(zend_op_array *op_array) { 
    33013303        zend_op* op = op_array->opcodes; 
    33023304        int len = op_array->last; 
     
    33223324 
    33233325  TSRMLS_FETCH(); 
    3324 /*??? 
    3325 #ifdef ZEND_ENGINE_2 
    3326   return; 
    3327 #endif 
    3328 */ 
     3326 
    33293327  if (!EAG(compiler) || op_array->type != ZEND_USER_FUNCTION) { 
    33303328    return; 
     
    33373335  /* Find All Basic Blocks and build CFG */ 
    33383336  if (build_cfg(op_array, bb)) { 
     3337    dump_bb(bb, op_array); 
    33393338    char *global = do_alloca(op_array->T * sizeof(char)); 
    33403339    if (global == NULL) return; 
     
    33433342      /* Determine Used Blocks and its Predcessors */ 
    33443343      mark_used_bb(bb); 
     3344      dump_bb(bb, op_array); 
    33453345 
    33463346      /* JMP Optimization */ 
     
    33553355      } 
    33563356 
    3357       /* Mark All Basik Blocks as Unused. Free Predcessors Links. */ 
     3357      /* Mark All Basic Blocks as Unused. Free Predcessors Links. */ 
    33583358      p = bb; 
    33593359      while (p != NULL) { 
     
    33683368    p = bb; 
    33693369    while (p->next != NULL) { 
    3370       if (p->next->used) { 
     3370      if (p->next->used || p->protect_merge) { 
    33713371        p = p->next; 
    33723372      } else { 
     
    33983398  free_alloca(bb); 
    33993399} 
    3400 #endif 
    3401 #endif /* #ifdef HAVE_EACCELERATOR */ 
     3400//#endif 
     3401//#endif /* #ifdef HAVE_EACCELERATOR */ 
Note: See TracChangeset for help on using the changeset viewer.