Changeset 405 for trunk/xcache.c


Ignore:
Timestamp:
2007-05-31T05:48:08+02:00 (7 years ago)
Author:
moo
Message:

full ZendOptimizer? compatibility

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/xcache.c

    r403 r405  
    8787 
    8888static zend_bool xc_initized = 0; 
     89static zend_compile_file_t *origin_compile_file = NULL; 
    8990static zend_compile_file_t *old_compile_file = NULL; 
    9091static zend_llist_element  *xc_llist_zend_extension = NULL; 
     
    974975    old_constinfo_cnt = zend_hash_num_elements(EG(zend_constants)); 
    975976 
     977    php->op_array = NULL; 
     978    XG(initial_compile_file_called) = 0; 
    976979    zend_try { 
    977980        op_array = old_compile_file(h, type TSRMLS_CC); 
     
    986989    if (op_array == NULL) { 
    987990        goto err_op_array; 
     991    } 
     992 
     993    if (!XG(initial_compile_file_called)) { 
     994        return op_array; 
    988995    } 
    989996 
     
    11641171} 
    11651172/* }}} */ 
     1173static zend_op_array *xc_check_initial_compile_file(zend_file_handle *h, int type TSRMLS_DC) /* {{{ */ 
     1174{ 
     1175    XG(initial_compile_file_called) = 1; 
     1176    return origin_compile_file(h, type TSRMLS_CC); 
     1177} 
     1178/* }}} */ 
    11661179static zend_op_array *xc_compile_file(zend_file_handle *h, int type TSRMLS_DC) /* {{{ */ 
    11671180{ 
     
    12901303        } 
    12911304 
     1305        /* not cachable */ 
     1306        if (!php.op_array) { 
     1307            cache->compiling = 0; 
     1308            xc_sandbox_free(&sandbox, XC_InstallNoBinding TSRMLS_CC); 
     1309            return op_array; 
     1310        } 
     1311 
    12921312        xce.data.php = &php; 
    12931313    } 
     
    13551375        } 
    13561376        if (newlycompiled) { 
    1357             xc_sandbox_free(&sandbox, 0 TSRMLS_CC); 
     1377            xc_sandbox_free(&sandbox, XC_NoInstall TSRMLS_CC); 
    13581378        } 
    13591379        return xc_compile_restore(stored_xce, h TSRMLS_CC); 
     
    13631383            /* install it */ 
    13641384            CG(active_op_array) = op_array; 
    1365             xc_sandbox_free(&sandbox, 1 TSRMLS_CC); 
     1385            xc_sandbox_free(&sandbox, XC_Install TSRMLS_CC); 
    13661386        } 
    13671387    } 
     
    13711391    if (newlycompiled) { 
    13721392        xc_free_php(&php TSRMLS_CC); 
    1373         xc_sandbox_free(&sandbox, 0 TSRMLS_CC); 
     1393        xc_sandbox_free(&sandbox, XC_NoInstall TSRMLS_CC); 
    13741394    } 
    13751395 
     
    15641584        zend_compile_file = old_compile_file; 
    15651585        old_compile_file = NULL; 
     1586    } 
     1587 
     1588    if (origin_compile_file) { 
     1589        zend_compile_file = origin_compile_file; 
     1590        origin_compile_file = NULL; 
    15661591    } 
    15671592 
     
    29152940#endif 
    29162941/* }}} */ 
    2917 static startup_func_t xc_last_ext_startup = NULL; 
     2942static startup_func_t xc_last_ext_startup; 
    29182943static int xc_zend_startup_last(zend_extension *extension) /* {{{ */ 
    29192944{ 
     
    29362961{ 
    29372962    xc_zend_extension_gotup = 1; 
     2963 
     2964    if (!origin_compile_file) { 
     2965        origin_compile_file = zend_compile_file; 
     2966        zend_compile_file = xc_check_initial_compile_file; 
     2967    } 
     2968 
    29382969    if (zend_llist_count(&zend_extensions) > 1) { 
    29392970        zend_llist_position lpos; 
Note: See TracChangeset for help on using the changeset viewer.