Changeset 477 for trunk/optimizer.c


Ignore:
Timestamp:
2007-08-19T16:15:51+02:00 (7 years ago)
Author:
moo
Message:

opcodes data is copied but not the op_array. use op_array_handler instead

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/optimizer.c

    r476 r477  
    77/* the "vector" stack */ 
    88#include "stack.h" 
     9#include "xcache_globals.h" 
    910 
    1011#ifdef DEBUG 
     
    1920#   define XCACHE_IS_CV 16 
    2021#endif 
    21 #define optimized_flag done_pass_two 
    2222 
    2323typedef int bbid_t; 
     
    516516    } 
    517517 
    518     /* don't optimize twice */ 
    519     if (op_array->optimized_flag) { 
    520         return 0; 
    521     } 
    522     op_array->optimized_flag = 1; 
    523  
    524518#ifdef DEBUG 
    525519#   if 0 
     
    557551} 
    558552/* }}} */ 
    559 static int xc_clear_flag_optimized(zend_op_array *op_array TSRMLS_DC) /* {{{ */ 
    560 { 
    561     op_array->done_pass_two = 0; 
    562     return 0; 
    563 } 
    564 /* }}} */ 
    565 void xc_optimize(zend_op_array *op_array TSRMLS_DC) /* {{{ */ 
    566 { 
    567     xc_compile_result_t cr; 
    568  
    569     if (!op_array) { 
    570         return; 
    571     } 
    572  
    573     xc_compile_result_init_cur(&cr, op_array TSRMLS_CC); 
    574  
    575     xc_apply_op_array(&cr, (apply_func_t) xc_undo_pass_two TSRMLS_CC); 
    576     /* op_array->done_pass_two is now used as if it's op_array->flag_optimized */ 
    577     xc_apply_op_array(&cr, (apply_func_t) xc_optimize_op_array TSRMLS_CC); 
    578     xc_apply_op_array(&cr, (apply_func_t) xc_clear_flag_optimized TSRMLS_CC); 
    579     xc_apply_op_array(&cr, (apply_func_t) xc_redo_pass_two TSRMLS_CC); 
    580  
    581     xc_compile_result_free(&cr); 
    582 } 
    583 /* }}} */ 
     553void xc_optimizer_op_array_handler(zend_op_array *op_array) /* {{{ */ 
     554{ 
     555    TSRMLS_FETCH(); 
     556    if (XG(optimizer)) { 
     557        xc_optimize_op_array(op_array TSRMLS_CC); 
     558    } 
     559} 
     560/* }}} */ 
Note: See TracChangeset for help on using the changeset viewer.