Changeset 322

Show
Ignore:
Timestamp:
05/24/07 18:32:49 (1 year ago)
Author:
bart
Message:

Revert stupid changes left over from debugging

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • eaccelerator/trunk/optimize.c

    r309 r322  
    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 applies to try & catch blocks. 
     48   * it abblies to try & catch blocks. 
    4949   * ZEND_ENGINE_2 specific, but can take place 
    5050   */ 
     
    6363} BBlink; 
    6464 
     65#if 0 
    6566static void dump_bb(BB* bb, zend_op_array *op_array) { 
    6667  BB* p = bb; 
     
    6869  zend_printf("<pre>%s:%s\n", op_array->filename, op_array->function_name); 
    6970  while (p != NULL) { 
    70     zend_printf("  <strong>bb%u</strong> start=%u len=%d used=%d protected=%d\n", 
     71    zend_printf("  bb%u start=%u len=%d used=%d\n", 
    7172                 (unsigned int)(p-bb), 
    7273                 (unsigned int)(p->start-op_array->opcodes), 
    7374                 p->len, 
    74                  p->used, 
    75                  p->protect_merge); 
     75                 p->used); 
    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 
    170171 
    171172#define SET_TO_NOP(op) \ 
     
    248249#ifdef ZEND_ENGINE_2 
    249250             (end->opcode == ZEND_RECV || end->opcode == ZEND_RECV_INIT || 
    250              (end->result.u.EA.type & EXT_TYPE_UNUSED) == 0)) || 
     251              (end->result.u.EA.type & EXT_TYPE_UNUSED) == 0)) || 
    251252#else 
    252253             (end->result.u.EA.type & EXT_TYPE_UNUSED) == 0) || 
    253254#endif 
    254255             (end->result.op_type == IS_TMP_VAR)) && 
    255             !global[VAR_NUM(end->result.u.var)] && !used[VAR_NUM(end->result.u.var)]) { 
     256            !global[VAR_NUM(end->result.u.var)] && !used[VAR_NUM(end->result.u.var)]) { 
    256257           switch(end->opcode) { 
    257258             case ZEND_JMPZ_EX: 
     
    548549    p = bb; 
    549550    while (p->next != NULL) { 
    550       if (p->next->used && (p->next->pred || p->protect_merge)) { 
     551      if (p->next->used && p->next->pred) { 
    551552        p = p->next; 
    552553      } else { 
     
    580581    p = bb; 
    581582    while (p != NULL) { 
    582       while (p->next != NULL && (!p->next->used || p->next->pred == NULL) && !p->protect_merge) { 
     583      while (p->next != NULL && (!p->next->used || p->next->pred == NULL)) { 
    583584        del_bb(p->next); 
    584585        p->next = p->next->next; 
     
    27142715                        bb[tc_element->catch_op].start = &op_array->opcodes[tc_element->catch_op]; 
    27152716                        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      
    27222719#endif 
    27232720        /* Find Starts of Basic Blocks */ 
     
    31783175#define FREE_REG(R) reg_pool[(R)] = 0; 
    31793176 
    3180 static void reassign_registers(zend_op_array *op_array, BB* p, char *global) { 
     3177 
     3178void reassign_registers(zend_op_array *op_array, BB* p, char *global) { 
    31813179  zend_uint i; 
    31823180  zend_uint n = 0; 
     
    33003298} 
    33013299 
    3302 static void restore_operand_types(zend_op_array *op_array) { 
     3300void restore_operand_types(zend_op_array *op_array) { 
    33033301        zend_op* op = op_array->opcodes; 
    33043302        int len = op_array->last; 
     
    33243322 
    33253323  TSRMLS_FETCH(); 
    3326  
     3324/*??? 
     3325#ifdef ZEND_ENGINE_2 
     3326  return; 
     3327#endif 
     3328*/ 
    33273329  if (!EAG(compiler) || op_array->type != ZEND_USER_FUNCTION) { 
    33283330    return; 
     
    33353337  /* Find All Basic Blocks and build CFG */ 
    33363338  if (build_cfg(op_array, bb)) { 
    3337     dump_bb(bb, op_array); 
    33383339    char *global = do_alloca(op_array->T * sizeof(char)); 
    33393340    if (global == NULL) return; 
     
    33423343      /* Determine Used Blocks and its Predcessors */ 
    33433344      mark_used_bb(bb); 
    3344       dump_bb(bb, op_array); 
    33453345 
    33463346      /* JMP Optimization */ 
     
    33553355      } 
    33563356 
    3357       /* Mark All Basic Blocks as Unused. Free Predcessors Links. */ 
     3357      /* Mark All Basik 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 || p->protect_merge) { 
     3370      if (p->next->used) { 
    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 */