Changeset 1281 in svn for trunk/mod_cacher/xc_cacher.c


Ignore:
Timestamp:
2013-07-08T10:00:36+02:00 (2 years ago)
Author:
Xuefer
Message:

remove php 4 support completely

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/mod_cacher/xc_cacher.c

    r1277 r1281  
    763763    xc_entry_data_php_t *p = entry_php->php;
    764764    zend_op_array *old_active_op_array = CG(active_op_array);
    765 #ifndef ZEND_ENGINE_2
    766     ALLOCA_FLAG(use_heap)
    767     /* new ptr which is stored inside CG(class_table) */
    768     xc_cest_t **new_cest_ptrs = (xc_cest_t **)xc_do_alloca(sizeof(xc_cest_t*) * p->classinfo_cnt, use_heap);
    769 #endif
    770765
    771766    CG(active_op_array) = p->op_array;
     
    790785    for (i = 0; i < p->classinfo_cnt; i ++) {
    791786        xc_classinfo_t *ci = &p->classinfos[i];
    792 #ifndef ZEND_ENGINE_2
    793         zend_class_entry *ce = CestToCePtr(ci->cest);
    794         /* fix pointer to the be which inside class_table */
    795         if (ce->parent) {
    796             zend_uint class_idx = (/* class_num */ (int) (long) ce->parent) - 1;
    797             assert(class_idx < i);
    798             ci->cest.parent = new_cest_ptrs[class_idx];
    799         }
    800         new_cest_ptrs[i] =
    801 #endif
    802787#ifdef ZEND_COMPILE_DELAYED_BINDING
    803         xc_install_class(entry_php->entry.name.str.val, &ci->cest, -1,
     788        xc_install_class(entry_php->entry.name.str.val, ci->class_entry, -1,
    804789                UNISW(0, ci->type), ci->key, ci->key_size, ci->h TSRMLS_CC);
    805790#else
    806         xc_install_class(entry_php->entry.name.str.val, &ci->cest, ci->oplineno,
     791        xc_install_class(entry_php->entry.name.str.val, ci->class_entry, ci->oplineno,
    807792                UNISW(0, ci->type), ci->key, ci->key_size, ci->h TSRMLS_CC);
    808793#endif
     
    826811#endif
    827812
    828     i = 1;
    829 #ifndef ZEND_ENGINE_2_2
    830     zend_hash_add(&EG(included_files), entry_php->entry.name.str.val, entry_php->entry.name.str.len+1, (void *)&i, sizeof(int), NULL);
    831 #endif
    832 
    833 #ifndef ZEND_ENGINE_2
    834     xc_free_alloca(new_cest_ptrs, use_heap);
    835 #endif
    836813    CG(active_op_array) = old_active_op_array;
    837814    return p->op_array;
     
    12981275    zend_uint i;
    12991276    int class_len;
    1300     xc_cest_t cest;
     1277    zend_class_entry *class_entry;
    13011278    xc_entry_data_php_t *php = (xc_entry_data_php_t *) data;
    13021279
    13031280    class_name = Z_OP_CONSTANT(opline->op1).value.str.val;
    13041281    class_len  = Z_OP_CONSTANT(opline->op1).value.str.len;
    1305     if (zend_hash_find(CG(class_table), class_name, class_len, (void **) &cest) == FAILURE) {
     1282    if (zend_hash_find(CG(class_table), class_name, class_len, (void **) &class_entry) == FAILURE) {
    13061283        assert(0);
    13071284    }
     
    17461723
    17471724#ifdef HAVE_XCACHE_CONSTANT
    1748         b = EG(zend_constants)->pListHead; COPY_H(xc_constinfo_t, constinfos, constinfo_cnt, constant, zend_constant);
    1749 #endif
    1750         b = CG(function_table)->pListHead; COPY_H(xc_funcinfo_t,  funcinfos,  funcinfo_cnt,  func,     zend_function);
    1751         b = CG(class_table)->pListHead;    COPY_H(xc_classinfo_t, classinfos, classinfo_cnt, cest,     xc_cest_t);
     1725        b = EG(zend_constants)->pListHead; COPY_H(xc_constinfo_t, constinfos, constinfo_cnt, constant,    zend_constant);
     1726#endif
     1727        b = CG(function_table)->pListHead; COPY_H(xc_funcinfo_t,  funcinfos,  funcinfo_cnt,  func,        zend_function);
     1728        b = CG(class_table)->pListHead;    COPY_H(xc_classinfo_t, classinfos, classinfo_cnt, class_entry, zend_class_entry *);
    17521729
    17531730#undef COPY_H
    1754 
    1755         /* for ZE1, cest need to be fixed inside store */
    17561731
    17571732#ifdef ZEND_ENGINE_2_1
     
    17911766        for (i = 0; i < compiler->new_php.classinfo_cnt; i ++) {
    17921767            xc_classinfo_t *classinfo = &compiler->new_php.classinfos[i];
    1793             zend_class_entry *ce = CestToCePtr(classinfo->cest);
    1794             classinfo->methodinfo_cnt = ce->function_table.nTableSize;
     1768            classinfo->methodinfo_cnt = classinfo->class_entry->function_table.nTableSize;
    17951769            if (classinfo->methodinfo_cnt) {
    17961770                int j;
     
    18011775                }
    18021776
    1803                 for (j = 0, b = ce->function_table.pListHead; b; j ++, b = b->pListNext) {
     1777                for (j = 0, b = classinfo->class_entry->function_table.pListHead; b; j ++, b = b->pListNext) {
    18041778                    xc_collect_op_array_info(compiler, &const_usage, &classinfo->methodinfos[j], (zend_op_array *) b->pData TSRMLS_CC);
    18051779                }
     
    20011975        /* discard newly compiled result, restore from stored one */
    20021976        if (compiler->new_php.op_array) {
    2003 #ifdef ZEND_ENGINE_2
    20041977            destroy_op_array(compiler->new_php.op_array TSRMLS_CC);
    2005 #else
    2006             destroy_op_array(compiler->new_php.op_array);
    2007 #endif
    20081978            efree(compiler->new_php.op_array);
    20091979            compiler->new_php.op_array = NULL;
     
    22692239    xc_gc_op_array_t *op_array = (xc_gc_op_array_t *) pDest;
    22702240    zend_uint i;
    2271 #ifdef ZEND_ENGINE_2
    22722241    if (op_array->arg_info) {
    22732242        for (i = 0; i < op_array->num_args; i++) {
     
    22792248        efree(op_array->arg_info);
    22802249    }
    2281 #endif
    22822250    if (op_array->opcodes) {
    22832251        efree(op_array->opcodes);
     
    27952763{
    27962764    if (!XG(internal_table_copied)) {
    2797         zend_function tmp_func;
    2798         xc_cest_t tmp_cest;
     2765        zend_function dummy_func;
     2766        zend_class_entry *dummy_class_entry;
    27992767
    28002768#ifdef HAVE_XCACHE_CONSTANT
     
    28132781        xc_copy_internal_zend_constants(&XG(internal_constant_table), EG(zend_constants));
    28142782#endif
    2815         zend_hash_copy(&XG(internal_function_table), CG(function_table), NULL, &tmp_func, sizeof(tmp_func));
    2816         zend_hash_copy(&XG(internal_class_table), CG(class_table), NULL, &tmp_cest, sizeof(tmp_cest));
     2783        zend_hash_copy(&XG(internal_function_table), CG(function_table), NULL, &dummy_func, sizeof(dummy_func));
     2784        zend_hash_copy(&XG(internal_class_table), CG(class_table), NULL, &dummy_class_entry, sizeof(dummy_class_entry));
    28172785
    28182786        XG(internal_table_copied) = 1;
     
    28202788    xc_holds_init(TSRMLS_C);
    28212789    xc_var_namespace_init(TSRMLS_C);
    2822 #ifdef ZEND_ENGINE_2
    28232790    zend_llist_init(&XG(gc_op_arrays), sizeof(xc_gc_op_array_t), xc_gc_op_array, 0);
    2824 #endif
    28252791
    28262792#if PHP_API_VERSION <= 20041225
     
    28432809    xc_gc_deletes(TSRMLS_C);
    28442810    xc_var_namespace_destroy(TSRMLS_C);
    2845 #ifdef ZEND_ENGINE_2
    28462811    zend_llist_destroy(&XG(gc_op_arrays));
    2847 #endif
    28482812}
    28492813/* }}} */
     
    37763740}
    37773741/* }}} */
    3778 /* {{{ static PHP_RSHUTDOWN_FUNCTION(xcache_cacher) */
    3779 #ifndef ZEND_ENGINE_2
    3780 static PHP_RSHUTDOWN_FUNCTION(xcache_cacher)
    3781 #else
     3742/* {{{ static ZEND_MODULE_POST_ZEND_DEACTIVATE_D(xcache_cacher) */
    37823743static ZEND_MODULE_POST_ZEND_DEACTIVATE_D(xcache_cacher)
    3783 #endif
    3784 {
    3785 #ifdef ZEND_ENGINE_2
     3744{
    37863745    TSRMLS_FETCH();
    3787 #endif
    37883746
    37893747    xc_request_shutdown(TSRMLS_C);
     
    37983756    PHP_MSHUTDOWN(xcache_cacher),
    37993757    PHP_RINIT(xcache_cacher),
    3800 #ifndef ZEND_ENGINE_2
    3801     PHP_RSHUTDOWN(xcache_cacher),
    3802 #else
    38033758    NULL,
    3804 #endif
    38053759    PHP_MINFO(xcache_cacher),
    38063760    XCACHE_VERSION,
     
    38083762    NO_MODULE_GLOBALS,
    38093763#endif
    3810 #ifdef ZEND_ENGINE_2
    38113764    ZEND_MODULE_POST_ZEND_DEACTIVATE_N(xcache_cacher),
    3812 #else
    3813     NULL,
    3814     NULL,
    3815 #endif
    38163765    STANDARD_MODULE_PROPERTIES_EX
    38173766};
Note: See TracChangeset for help on using the changeset viewer.