Changeset 548 in svn for trunk


Ignore:
Timestamp:
2008-03-21T15:36:17+01:00 (7 years ago)
Author:
Xuefer
Message:

PHP_5_3 support: uses ZEND_COMPILE_IGNORE_INTERNAL_CLASSES and ZEND_COMPILE_DELAYED_BINDING stuffs for PHP_5_3 support finally

Location:
trunk
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/coverager.c

    r543 r548  
    246246    if (XG(coverager)) {
    247247        xc_coverager_enable(TSRMLS_C);
     248#ifdef ZEND_COMPILE_EXTENDED_INFO
     249        CG(compiler_options) |= ZEND_COMPILE_EXTENDED_INFO;
     250#else
    248251        CG(extended_info) = 1;
     252#endif
    249253    }
    250254    else {
  • trunk/processor/processor.m4

    r534 r548  
    506506    dnl main op_array && have early binding
    507507    zend_uint ii;
    508     if (!processor->readonly_protection && !(src == processor->php_src->op_array && processor->php_src->have_early_binding)) {
     508#ifdef ZEND_COMPILE_DELAYED_BINDING
     509    zend_bool need_early_binding = 0;
     510#else
     511    zend_bool need_early_binding = processor->php_src->have_early_binding;
     512#endif
     513    if (!processor->readonly_protection && !(src == processor->php_src->op_array && need_early_binding)) {
    509514        /* really fast shallow copy */
    510515        memcpy(dst, src, sizeof(src[0]));
     
    633638    PROC_ZSTRING_L(, doc_comment, doc_comment_len)
    634639#endif
     640#ifdef ZEND_COMPILE_DELAYED_BINDING
     641    DISPATCH(zend_uint, early_binding);
     642#endif
    635643
    636644    /* reserved */
     
    730738    STRUCT(zend_class_entry, cest)
    731739#endif
     740#ifndef ZEND_COMPILE_DELAYED_BINDING
    732741    DISPATCH(int, oplineno)
     742#endif
    733743')
    734744dnl }}}
     
    807817    ')
    808818#endif
     819#ifndef ZEND_COMPILE_DELAYED_BINDING
    809820    DISPATCH(zend_bool, have_early_binding)
     821#endif
    810822    DISPATCH(zend_bool, have_references)
    811823')
  • trunk/utils.c

    r545 r548  
    500500                    ZESW(&stored_ce_ptr, NULL)
    501501                    );
     502#ifndef ZEND_COMPILE_DELAYED_BINDING
    502503        if (oplineno != -1) {
    503504            xc_do_early_binding(CG(active_op_array), CG(class_table), oplineno TSRMLS_CC);
    504505        }
     506#endif
    505507    }
    506508    else if (zend_u_hash_quick_add(CG(class_table), type, key, len, h,
     
    673675#endif
    674676
     677#ifdef ZEND_COMPILE_IGNORE_INTERNAL_CLASSES
     678    sandbox->orig_compiler_options = CG(compiler_options);
     679    /* Using ZEND_COMPILE_IGNORE_INTERNAL_CLASSES for ZEND_FETCH_CLASS_RT_NS_CHECK
     680     */
     681    CG(compiler_options) |= ZEND_COMPILE_IGNORE_INTERNAL_CLASSES | ZEND_COMPILE_DELAYED_BINDING;
     682#endif
     683
    675684    XG(sandbox) = (void *) sandbox;
    676685    return sandbox;
     
    728737
    729738    if (install != XC_InstallNoBinding) {
     739#ifdef ZEND_COMPILE_DELAYED_BINDING
     740        zend_do_delayed_early_binding(CG(active_op_array) TSRMLS_CC);
     741#else
    730742        xc_undo_pass_two(CG(active_op_array) TSRMLS_CC);
    731743        xc_foreach_early_binding_class(CG(active_op_array), xc_early_binding_cb, (void *) sandbox TSRMLS_CC);
    732744        xc_redo_pass_two(CG(active_op_array) TSRMLS_CC);
     745#endif
    733746    }
    734747
     
    805818    }
    806819#endif
     820
     821#ifdef ZEND_COMPILE_IGNORE_INTERNAL_CLASSES
     822    CG(compiler_options) = sandbox->orig_compiler_options;
     823#endif
     824
    807825    if (sandbox->alloc) {
    808826        efree(sandbox);
  • trunk/utils.h

    r543 r548  
    105105    xc_compilererror_t *compilererrors;
    106106#endif
     107
     108#ifdef ZEND_COMPILE_IGNORE_INTERNAL_CLASSES
     109    zend_uint orig_compiler_options;
     110#endif
    107111} xc_sandbox_t;
    108112
  • trunk/xcache.c

    r547 r548  
    720720        new_cest_ptrs[i] =
    721721#endif
     722#ifdef ZEND_COMPILE_DELAYED_BINDING
     723        xc_install_class(xce->name.str.val, &ci->cest, -1,
     724                UNISW(0, ci->type), ci->key, ci->key_size, ci->h TSRMLS_CC);
     725#else
    722726        xc_install_class(xce->name.str.val, &ci->cest, ci->oplineno,
    723727                UNISW(0, ci->type), ci->key, ci->key_size, ci->h TSRMLS_CC);
     728#endif
    724729    }
    725730
     
    10431048}
    10441049/* }}} */
     1050#ifndef ZEND_COMPILE_DELAYED_BINDING
    10451051static void xc_cache_early_binding_class_cb(zend_op *opline, int oplineno, void *data TSRMLS_DC) /* {{{ */
    10461052{
     
    10701076}
    10711077/* }}} */
     1078#endif
    10721079static void xc_free_php(xc_entry_data_php_t *php TSRMLS_DC) /* {{{ */
    10731080{
     
    12381245    php->compilererror_cnt = ((xc_sandbox_t *) XG(sandbox))->compilererror_cnt;
    12391246#endif
     1247#ifndef ZEND_COMPILE_DELAYED_BINDING
    12401248    /* {{{ find inherited classes that should be early-binding */
    12411249    php->have_early_binding = 0;
     
    12481256    xc_redo_pass_two(php->op_array TSRMLS_CC);
    12491257    /* }}} */
     1258#endif
    12501259
    12511260    return op_array;
  • trunk/xcache.h

    r547 r548  
    243243    ulong     h;
    244244    xc_cest_t cest;
     245#ifndef ZEND_COMPILE_DELAYED_BINDING
    245246    int       oplineno;
     247#endif
    246248} xc_classinfo_t;
    247249/* }}} */
     
    316318    zend_uint classinfo_cnt;
    317319    xc_classinfo_t *classinfos;
     320#ifndef ZEND_COMPILE_DELAYED_BINDING
    318321    zend_bool have_early_binding;
     322#endif
    319323
    320324#ifdef ZEND_ENGINE_2_1
Note: See TracChangeset for help on using the changeset viewer.