Changeset 721 in svn


Ignore:
Timestamp:
2011-04-09T13:05:07+02:00 (4 years ago)
Author:
Xuefer
Message:

PHP_6: prepared in literal way for FILE DIR fix up

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/hashtable.m4

    r534 r721  
    6565
    6666            efree(buf);
    67             return; /* no check size */
    6867        ', `
    6968        dnl }}}
  • trunk/processor/processor.m4

    r716 r721  
    8585#endif
    8686    } while(0);
    87     return;
    8887    ', `
    8988        dnl IFDASM else
     
    323322#endif
    324323
     324#ifdef ZEND_ENGINE_2
     325    STRUCT(HashTable, properties_info, HashTable_zend_property_info)
     326#endif
     327
    325328#ifdef ZEND_ENGINE_2_4
    326329    DISPATCH(int, default_properties_count)
     
    334337    DONE(builtin_functions)
    335338    STRUCT(HashTable, default_properties, HashTable_zval_ptr)
    336 #   ifdef ZEND_ENGINE_2
    337     STRUCT(HashTable, properties_info, HashTable_zend_property_info)
    338 #       ifdef ZEND_ENGINE_2_1
     339#   ifdef ZEND_ENGINE_2_1
    339340    STRUCT(HashTable, default_static_members, HashTable_zval_ptr)
    340341    IFCOPY(`dst->static_members = &dst->default_static_members;')
    341342    DONE(static_members)
    342 #       else
     343#   elif defined(ZEND_ENGINE_2)
    343344    STRUCT_P(HashTable, static_members, HashTable_zval_ptr)
    344 #       endif
    345345#   endif
    346346#endif /* ZEND_ENGINE_2_4 */
     
    486486undefine(`UNION_znode_op')
    487487define(`UNION_znode_op', `dnl {{{
    488     assert(src->$1_type == IS_CONST ||
    489         src->$1_type == IS_VAR ||
    490         src->$1_type == IS_CV ||
    491         src->$1_type == IS_TMP_VAR ||
    492         src->$1_type == IS_UNUSED);
     488    switch ((src->$1_type & ~EXT_TYPE_UNUSED)) {
     489    case IS_CONST:
     490    case IS_VAR:
     491    case IS_CV:
     492    case IS_TMP_VAR:
     493    case IS_UNUSED:
     494        break;
     495
     496    default:
     497        assert(0);
     498    }
     499
    493500    dnl dirty dispatch
    494501    DISABLECHECK(`
    495     switch (src->$1_type) {
     502    switch ((src->$1_type & ~EXT_TYPE_UNUSED)) {
    496503        case IS_CONST:
    497504            dnl TODO: fix me, use literals
     
    659666#endif
    660667        IFRESTORE(`dst->filename = processor->entry_src->filepath;')
     668#ifndef ZEND_ENGINE_2_4
    661669        if (op_array_info->oplineinfo_cnt) {
    662670            gc_opcodes = 1;
    663671            COPY_N_EX(last, zend_op, opcodes)
    664672        }
     673#endif
    665674        if (gc_arg_info || gc_opcodes) {
    666675            xc_gc_op_array_t gc_op_array;
     
    889898#endif
    890899DEF_STRUCT_P_FUNC(`xc_op_array_info_t', , `dnl {{{
     900#ifdef ZEND_ENGINE_2_4
     901    DISPATCH(zend_uint, literalinfo_cnt)
     902    DISPATCH_ARRAY(literalinfo_cnt, int, literalinfos)
     903#else
    891904    DISPATCH(zend_uint, oplineinfo_cnt)
    892905    DISPATCH_ARRAY(oplineinfo_cnt, int, oplineinfos)
     906#endif
    893907')
    894908dnl }}}
  • trunk/xcache.c

    r716 r721  
    11771177
    11781178/* {{{ Constant Usage */
    1179 #define xcache_op1_is_file 1
    1180 #define xcache_op1_is_dir  2
    1181 #define xcache_op2_is_file 4
    1182 #define xcache_op2_is_dir  8
     1179#ifdef ZEND_ENGINE_2_4
     1180#else
     1181#   define xcache_op1_is_file 1
     1182#   define xcache_op1_is_dir  2
     1183#   define xcache_op2_is_file 4
     1184#   define xcache_op2_is_dir  8
     1185#endif
    11831186typedef struct {
    11841187    zend_bool filepath_used;
     
    11901193static void xc_collect_op_array_info(xc_entry_t *xce, xc_entry_data_php_t *php, xc_const_usage_t *usage, xc_op_array_info_t *op_array_info, zend_op_array *op_array TSRMLS_DC) /* {{{ */
    11911194{
     1195#ifdef ZEND_ENGINE_2_4
    11921196    int oplineno;
     1197#else
     1198    int oplineno;
     1199#endif
    11931200    xc_vector_t vector_int;
    11941201
    11951202    xc_vector_init(int, &vector_int);
    11961203
     1204#ifdef ZEND_ENGINE_2_4
     1205#else
    11971206#define XCACHE_CHECK_OP(type, op) \
    11981207    if (zend_binary_strcmp(Z_STRVAL(Z_OP_CONSTANT(opline->op)), Z_STRLEN(Z_OP_CONSTANT(opline->op)), xce->type##path, xce->type##path_len) == 0) { \
     
    12441253    op_array_info->oplineinfo_cnt = vector_int.cnt;
    12451254    op_array_info->oplineinfos    = xc_vector_detach(int, &vector_int);
     1255#endif
    12461256    xc_vector_free(int, &vector_int);
    12471257}
     
    12491259void xc_fix_op_array_info(const xc_entry_t *xce, const xc_entry_data_php_t *php, zend_op_array *op_array, int copy, const xc_op_array_info_t *op_array_info TSRMLS_DC) /* {{{ */
    12501260{
     1261#ifdef ZEND_ENGINE_2_4
     1262#else
    12511263    int i;
    1252     if (!op_array_info->oplineinfo_cnt) {
    1253         return;
    1254     }
    1255 
     1264#endif
     1265
     1266#ifdef ZEND_ENGINE_2_4
     1267#else
    12561268    for (i = 0; i < op_array_info->oplineinfo_cnt; i += 2) {
    12571269        int oplineno = op_array_info->oplineinfos[i];
     
    13401352        }
    13411353    }
     1354#endif
    13421355}
    13431356/* }}} */
    13441357static void xc_free_op_array_info(xc_op_array_info_t *op_array_info TSRMLS_DC) /* {{{ */
    13451358{
     1359#ifdef ZEND_ENGINE_2_4
     1360    if (op_array_info->literalinfos) {
     1361        efree(op_array_info->literalinfos);
     1362    }
     1363#else
    13461364    if (op_array_info->oplineinfos) {
    13471365        efree(op_array_info->oplineinfos);
    13481366    }
     1367#endif
    13491368}
    13501369/* }}} */
  • trunk/xcache.h

    r716 r721  
    259259/* {{{ xc_op_array_info_t */
    260260typedef struct {
     261#ifdef ZEND_ENGINE_2_4
     262    zend_uint literalinfo_cnt;
     263    int *literalinfos;
     264#else
    261265    zend_uint oplineinfo_cnt;
    262266    int *oplineinfos;
     267#endif
    263268} xc_op_array_info_t;
    264269/* }}} */
Note: See TracChangeset for help on using the changeset viewer.