Changeset 335 in svn


Ignore:
Timestamp:
2006-12-17T04:17:52+01:00 (9 years ago)
Author:
Xuefer
Message:

optimizer: remove double xc_undo_pass_two/xc_redo_pass_two, avoid optimize more than once on same op_array

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/optimizer.c

    r333 r335  
    1919#   define XCACHE_IS_CV 16
    2020#endif
     21#define optimized_flag done_pass_two
    2122
    2223typedef int bbid_t;
     
    511512        return 0;
    512513    }
    513     xc_undo_pass_two(op_array TSRMLS_CC);
     514
     515    /* don't optimize twice */
     516    if (op_array->optimized_flag) {
     517        return 0;
     518    }
     519    op_array->optimized_flag = 1;
     520
    514521#ifdef DEBUG
    515522#   if 0
     
    543550#   endif
    544551#endif
    545     xc_redo_pass_two(op_array TSRMLS_CC);
    546552    return 0;
     553}
     554/* }}} */
     555int xc_clear_flag_optimized(zend_op_array *op_array TSRMLS_DC) /* {{{ */
     556{
     557    op_array->done_pass_two = 0;
    547558}
    548559/* }}} */
     
    558569
    559570    xc_apply_op_array(&cr, (apply_func_t) xc_undo_pass_two TSRMLS_CC);
     571    /* op_array->done_pass_two is now used as if it's op_array->flag_optimized */
    560572    xc_apply_op_array(&cr, (apply_func_t) xc_optimize_op_array TSRMLS_CC);
     573    xc_apply_op_array(&cr, (apply_func_t) xc_clear_flag_optimized TSRMLS_CC);
    561574    xc_apply_op_array(&cr, (apply_func_t) xc_redo_pass_two TSRMLS_CC);
    562575
Note: See TracChangeset for help on using the changeset viewer.